diff --git a/mxmount/mxmount b/mxmount/mxmount index 237771a..af0926c 100755 --- a/mxmount/mxmount +++ b/mxmount/mxmount @@ -20,9 +20,10 @@ my %D; our $USAGE=<<"_EOF_"; usage: $0 $0 --reexport-only + $0 --noexport _EOF_ -our ($opt_reexport_only); +our ($opt_reexport_only,$opt_noexport); $fullhostname = hostname(); ($hostname) = $fullhostname =~ /^([^.]*)/; @@ -52,12 +53,13 @@ add_data0_if_not_present(); my %options; GetOptions ( 'reexport-only' => \$opt_reexport_only, + 'noexport' => \$opt_noexport, ) or die $USAGE; @ARGV and die $USAGE; mount_all() unless $opt_reexport_only; create_exports(); -system("exportfs -ra"); +system("exportfs -ra") unless $opt_noexport; sub safe_qx { open my $pipe,'-|',@_; return join('',<$pipe>) } diff --git a/mxmount/mxmount.service b/mxmount/mxmount.service index 6434001..c5d64ae 100644 --- a/mxmount/mxmount.service +++ b/mxmount/mxmount.service @@ -5,7 +5,7 @@ ConditionPathExists=/etc/mxmounts [Service] Type=oneshot -ExecStart=/usr/bin/mxmount +ExecStart=/usr/bin/mxmount --noexport RemainAfterExit=yes [Install]