Skip to content

mxmount: Add option --noexport #71

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mxmount/mxmount
Original file line number Diff line number Diff line change
Expand Up @@ -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 =~ /^([^.]*)/;
Expand Down Expand Up @@ -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>) }

Expand Down
2 changes: 1 addition & 1 deletion mxmount/mxmount.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ConditionPathExists=/etc/mxmounts

[Service]
Type=oneshot
ExecStart=/usr/bin/mxmount
ExecStart=/usr/bin/mxmount --noexport
RemainAfterExit=yes

[Install]
Expand Down