diff --git a/clusterd b/clusterd index 2d160ee..624ec61 100755 --- a/clusterd +++ b/clusterd @@ -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'); @@ -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, ); @@ -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; @@ -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 @@ -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; @@ -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;