summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/network/nfs.pm52
1 files changed, 24 insertions, 28 deletions
diff --git a/lib/network/nfs.pm b/lib/network/nfs.pm
index 32ee90c..b288975 100644
--- a/lib/network/nfs.pm
+++ b/lib/network/nfs.pm
@@ -11,18 +11,18 @@ sub read_nfs_ports() {
my $lockd_udp_port = 4002;
my $rpc_mountd_port = 4003;
my $rpc_rquotad_port = 4004;
- if (-f "$::prefix/etc/sysconfig/nfs-common") {
- foreach (cat_("$::prefix/etc/sysconfig/nfs-common")) {
- /^STATD_OPTIONS=.*(--port|-p) (\d+)/ and $statd_port = $2;
- /^STATD_OPTIONS=.*(--outgoing-port|-o) (\d+)/ and $statd_outgoing_port = $2;
+ if (-f "$::prefix/etc/sysconfig/nfs") {
+ foreach (cat_("$::prefix/etc/sysconfig/nfs")) {
+ /^STATDARGS=.*(--port|-p) (\d+)/ and $statd_port = $2;
+ /^STATDARGS=.*(--outgoing-port|-o) (\d+)/ and $statd_outgoing_port = $2;
/^LOCKD_TCPPORT=(\d+)/ and $lockd_tcp_port = $1;
/^LOCKD_UDPPORT=(\d+)/ and $lockd_udp_port = $1;
}
}
- if (-f "$::prefix/etc/sysconfig/nfs-server") {
- foreach (cat_("$::prefix/etc/sysconfig/nfs-server")) {
- /^RPCMOUNTD_OPTIONS=.*(--port|-p) (\d+)/ and $rpc_mountd_port = $2;
- /^RPCRQUOTAD_OPTIONS=.*(--port|-p) (\d+)/ and $rpc_rquotad_port = $2;
+ if (-f "$::prefix/etc/sysconfig/nfs") {
+ foreach (cat_("$::prefix/etc/sysconfig/nfs")) {
+ /^RPCMOUNTDARGS=.*(--port|-p) (\d+)/ and $rpc_mountd_port = $2;
+ /^RPCRQUOTADARGS=.*(--port|-p) (\d+)/ and $rpc_rquotad_port = $2;
}
}
@@ -56,14 +56,13 @@ sub list_nfs_ports() {
sub write_nfs_ports {
my ($ports) = @_;
# enabling fixed ports for NFS services
- # nfs-common
my $lockd_options="";
substInFile {
if ($ports->{statd_port}) {
my $port = $ports->{statd_port};
- s/^(STATD_OPTIONS)=$/$1="--port $port"/;
- s/^(STATD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/;
- s/^(STATD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/;
+ s/^(STATDARGS)=""$/$1="--port $port"/;
+ s/^(STATDARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/;
+ s/^(STATDARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/;
}
if ($ports->{lockd_tcp_port}) {
my $port = $ports->{lockd_tcp_port};
@@ -72,29 +71,26 @@ sub write_nfs_ports {
if ($ports->{lockd_udp_port}) {
my $port = $ports->{lockd_udp_port};
s/^LOCKD_UDPPORT=.*/LOCKD_UDPPORT=$port/;
+ }
+ if ($ports->{rpc_mountd_port}) {
+ my $port = $ports->{rpc_mountd_port};
+ s/^(RPCMOUNTDARGS)=""$/$1="--port $port"/;
+ s/^(RPCMOUNTDARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/;
+ s/^(RPCMOUNTDARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/;
+ }
+ if ($ports->{rpc_rquotad_port}) {
+ my $port = $ports->{rpc_rquotad_port};
+ s/^(RPCRQUOTADARGS)=""$/$1="--port $port"/;
+ s/^(RPCRQUOTADARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/;
+ s/^(RPCRQUOTADARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/;
}
- } "$::prefix/etc/sysconfig/nfs-common";
+ } "$::prefix/etc/sysconfig/nfs";
# kernel-side configuration of nlockmgr
$lockd_options .= " nlm_tcpport=$ports->{lockd_tcp_port}" if $ports->{lockd_tcp_port};
$lockd_options .= " nlm_udpport=$ports->{lockd_udp_port}" if $ports->{lockd_udp_port};
if ($lockd_options ne "") {
output("$::prefix/etc/modprobe.d/lockd.drakx.conf", "options lockd $lockd_options\n");
}
- # nfs-server
- substInFile {
- if ($ports->{rpc_mountd_port}) {
- my $port = $ports->{rpc_mountd_port};
- s/^(RPCMOUNTD_OPTIONS)=$/$1="--port $port"/;
- s/^(RPCMOUNTD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/;
- s/^(RPCMOUNTD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/;
- }
- if ($ports->{rpc_rquotad_port}) {
- my $port = $ports->{rpc_rquotad_port};
- s/^(RPCRQUOTAD_OPTIONS)=$/$1="--port $port"/;
- s/^(RPCRQUOTAD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/;
- s/^(RPCRQUOTAD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/;
- }
- } "$::prefix/etc/sysconfig/nfs-server";
}
1;