From d5cf90d3dc411f412ddec22bd65d2bd0d17f0cd4 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 22 Nov 2018 13:47:38 +0100 Subject: [PATCH] clusterd: add --reexport `clusterd --reexport` triggers all clusterd daemons to run `mxmount --reexport-only`. This should be done, when the export groups in hostconfig were updated. --- clusterd/clusterd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clusterd/clusterd b/clusterd/clusterd index 510cfb7..fe40fef 100755 --- a/clusterd/clusterd +++ b/clusterd/clusterd @@ -579,6 +579,7 @@ our %UDP_HANDLER= 'restart' => \&udp_rx_restart, 'flush-gidcache' => \&udp_rx_flush_gidcache, 'make-automaps' => \&udp_rx_make_automaps, + 'reexport' => \&udp_rx_reexport, 'log' => \&udp_rx_log, 'exec' => \&udp_rx_exec, 'push' => \&udp_rx_push, @@ -1089,6 +1090,10 @@ sub udp_rx_make_automaps { system '/sbin/make-automaps'; } +sub udp_rx_reexport { + system '/usr/bin/mxmount --reexport-only'; +} + #----------- tcp mgmt console ----------------------------- our $MGMT_PORT=234; @@ -1824,6 +1829,7 @@ usage: $0 [options] --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 + --reexport # execute /usr/bin/mxmount --reexport-only on all nodes --lsof=pattern @@ -1851,6 +1857,7 @@ GetOptions 'send-restart' => \$options{'send-restart'}, 'flush-gidcache' => \$options{'flush-gidcache'}, 'make-automaps' => \$options{'make-automaps'}, + 'reexport' => \$options{'reexport'}, 'lsof=s' => \$options{'lsof'}, ) or die USAGE; @@ -1885,6 +1892,10 @@ if (defined $options{'push'}) { sync_cluster_pw() or die "$CLUSTER_PW_FILE: $!\n"; $donald_s=new My::Select::INET(Proto=>'udp') or die "$!\n"; udp_broadcast_message($donald_s,'make-automaps'); +} elsif (defined $options{'reexport'}) { + sync_cluster_pw() or die "$CLUSTER_PW_FILE: $!\n"; + $donald_s=new My::Select::INET(Proto=>'udp') or die "$!\n"; + udp_broadcast_message($donald_s,'reexport'); } elsif (defined $options{'daemon'}) { $options{'kill'} and Donald::Tools::kill_previous_server('clusterd') and sleep 2;