Skip to content

Commit

Permalink
implement --make-automaps
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Feb 15, 2017
1 parent a98568a commit 0175eea
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion clusterd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use strict;

# https://github.molgen.mpg.de/mariux64/clusterd

our $REVISION='1.107';
our $REVISION='1.108';

#use lib ('/home/buczek/cluster/Donald/blib/lib');

Expand Down Expand Up @@ -307,6 +307,7 @@ our %UDP_HANDLER=
'loadavg.2' => \&udp_rx_loadavg2,
'restart' => \&udp_rx_restart,
'flush-gidcache' => \&udp_rx_flush_gidcache,
'make-automaps' => \&udp_rx_make_automaps,
'log' => \&udp_rx_log,
'exec' => \&udp_rx_exec,
);
Expand Down Expand Up @@ -797,6 +798,15 @@ sub udp_rx_flush_gidcache {
}
}

sub udp_rx_make_automaps {
if (open my $out,'>','/proc/net/rpc/auth.unix.gid/flush') {
print $out time();
} else {
warn "proc/net/rpc/auth.unix.gid/flush: $!\n";
}
system '/sbin/make-automaps';
}

#----------- tcp mgmt console -----------------------------

our $MGMT_PORT=234;
Expand Down Expand Up @@ -1398,6 +1408,7 @@ usage: $0 [options]
--exec mkmotd # execute /usr/sbin/mkmotd.pl on all nodes
--exec @node cmd [args...] # execute cmd on node
--flush-gidcache # flush rpc auth.unix.gid cache on all nodes
--make-automaps # execute /usr/sbin/make-automaps on all nodes
--lsof=pattern
Expand All @@ -1422,6 +1433,7 @@ GetOptions
'push-amd-tar' => \$options{'push_amd_tar'},
'send-restart' => \$options{'send-restart'},
'flush-gidcache' => \$options{'flush-gidcache'},
'make-automaps' => \$options{'make-automaps'},
'lsof=s' => \$options{'lsof'},

) or die USAGE;
Expand Down Expand Up @@ -1452,6 +1464,10 @@ if (defined $options{'push'}) {
sync_cluster_pw() or die "$CLUSTER_PW_FILE: $!\n";
$donald_s=new Donald::Select::INET(Proto=>'udp') or die "$!\n";
udp_broadcast_message($donald_s,'flush-gidcache');
} elsif (defined $options{'make-automaps'}) {
sync_cluster_pw() or die "$CLUSTER_PW_FILE: $!\n";
$donald_s=new Donald::Select::INET(Proto=>'udp') or die "$!\n";
udp_broadcast_message($donald_s,'make-automaps');
} elsif (defined $options{'daemon'}) {
$options{'kill'} and Donald::Tools::kill_previous_server('clusterd') and sleep 2;

Expand Down

0 comments on commit 0175eea

Please sign in to comment.