diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2009-08-26 10:00:38 -0500 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:41:17 +0200 |
commit | 5a12e7c134274dba706667107d10d231517d3e05 (patch) | |
tree | 55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/n/portmap/rc.rpc | |
download | current-5a12e7c134274dba706667107d10d231517d3e05.tar.gz current-5a12e7c134274dba706667107d10d231517d3e05.tar.xz |
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009
Slackware 13.0 x86_64 is released as stable! Thanks to everyone who
helped make this release possible -- see the RELEASE_NOTES for the
credits. The ISOs are off to the replicator. This time it will be a
6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We're taking pre-orders now at store.slackware.com. Please consider
picking up a copy to help support the project. Once again, thanks to
the entire Slackware community for all the help testing and fixing
things and offering suggestions during this development cycle.
As always, have fun and enjoy! -P.
Diffstat (limited to 'source/n/portmap/rc.rpc')
-rw-r--r-- | source/n/portmap/rc.rpc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/source/n/portmap/rc.rpc b/source/n/portmap/rc.rpc new file mode 100644 index 000000000..43492329b --- /dev/null +++ b/source/n/portmap/rc.rpc @@ -0,0 +1,60 @@ +#!/bin/sh +# rc.rpc: start/stop/restart RPC daemons needed to use NFS. +# +# You must run these daemons in order to mount NFS partitions +# (unless you use the mount option '-o nolock', which can +# corrupt files and is not generally recommended unless you +# are mounting the partition(s) as read-only). +# +# To run an NFS server, starting these is mandatory. +# + +rpc_start() { + if [ -x /sbin/rpc.portmap -a -x /sbin/rpc.statd ]; then + if ! ps axc | grep -q rpc.portmap ; then + echo "Starting RPC portmapper: /sbin/rpc.portmap" + /sbin/rpc.portmap + fi + if ! ps axc | grep -q rpc.statd ; then + echo "Starting RPC NSM (Network Status Monitor): /sbin/rpc.statd" + /sbin/rpc.statd + fi + else + echo "WARNING: Cannot start RPC daemons needed for NFS. One or more of" + echo " these required daemons is not executable or is not present" + echo " on your system:" + echo + echo " /sbin/rpc.portmap or /sbin/rpc.statd" + echo + fi +} + +rpc_stop() { + killall rpc.statd 2> /dev/null + sleep 1 + killall rpc.portmap 2> /dev/null + sleep 1 + killall -9 rpc.statd 2> /dev/null # make sure :) + sleep 1 + killall -9 rpc.portmap 2> /dev/null # make sure :) + sleep 1 +} + +rpc_restart() { + rpc_stop + rpc_start +} + +case "$1" in +'start') + rpc_start + ;; +'stop') + rpc_stop + ;; +'restart') + rpc_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |