View previous topic :: View next topic |
Author |
Message |
drifter n00b
Joined: 14 Feb 2018 Posts: 3 Location: Canada
|
Posted: Fri Jul 20, 2018 6:13 pm Post subject: How to set a static port for rpc-statd w/ systemd [SOLVED] |
|
|
I've been scratching my head trying to figure this out.
I've edited /etc/conf.d/nfs and changed the ports there using the default: OPTS_RPC_STATD, and also STATDARGS, RPCSTATDARGS.
I've added and edited /etc/sysconfig/nfs according to the redhat and archlinux wiki, a long shot but no dice.
I'm able to set a static port by running # rpc.statd -p 1234, but having to stop and start rpc-statd after every boot is a pain.
I also had a problem setting a static port for mountd, but after adding an entry in /etc/services I got that working.
Is there a better way than that to set a static mountd port?
I tried adding an entry for statd in /etc/services but it made no difference. (tried using the name statd, rpc-statd)
I tried to find which variable was being used in the systemd unit files but didn't see any, would I be able to set one there and if so where and how?
I'm considering writing a script which grabs the ports I need for status from rpcinfo -p then updates the firewall accordingly, but that just seems like overkill.
Has anyone else had any luck setting static ports for statd and mountd under systemd?
Any help would be greatly appreciated.
Last edited by drifter on Sat Jul 21, 2018 5:24 am; edited 1 time in total |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Fri Jul 20, 2018 10:11 pm Post subject: |
|
|
You could try the steps below:
Code: | 1) cp /lib/systemd/system/rpc-statd /etc/systemd/system
2) Edit /etc/systemd/system/rpc-statd and change the line
ExecStart=/sbin/rpc.statd
to
ExecStart=/sbin/rpc.statd -p 1224
3) systemctl daemon-reload
4) systemctl restart rpc-statd.service
5) ps -fe | grep rpc.statd
will now show:
root 5346 1 0 00:00 ? 00:00:00 /sbin/rpc.statd -p 1234
|
If you want to revert the change: just delete file /etc/systemd/system/rpc-statd and perform steps 3, 4 and 5. |
|
Back to top |
|
|
drifter n00b
Joined: 14 Feb 2018 Posts: 3 Location: Canada
|
Posted: Sat Jul 21, 2018 5:19 am Post subject: Solved |
|
|
Awesome! Thanks a bunch for your time and solution! That did the trick. |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
|
Back to top |
|
|
|