Skip to content

Commit

Permalink
clusterd: add --reexport
Browse files Browse the repository at this point in the history
`clusterd --reexport` triggers all clusterd daemons to run `mxmount
--reexport-only`. This should be done, when the export groups in
hostconfig were updated.
  • Loading branch information
donald committed Nov 22, 2018
1 parent 24b66dc commit d5cf90d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions clusterd/clusterd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit d5cf90d

Please sign in to comment.