nfs server script

Miroslav Rovis m.rovis at inet.hr
Tue Feb 24 13:33:20 PST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear people at Linux From Scratch!

This script appears to work on my box. No modifications to the
other boot scripts from the book are really necessary.
It is a fitting addition to them, if I am right.
At least with a touch or two of someone more knowledgable out
there it should. If the other box is set and running, all is
well...
 - - - - - - - - - - - - - - - - - - - - - - - - -
|	Pls. use it at your own risk!		  |
 - - - - - - - - - - - - - - - - - - - - - - - - -
I am not an expert, I only think this should work 

cat > /etc/rc.d/init.d/nfsserv << "EOF"

#!/bin/sh
#  Begin $rc_base/init.d/nfsserv
#+ Based on portmap script from BLFS book version CVS-20040112
#+ and earlier. It start nfs server along with the other
#+ services you get in the book.

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
        start)
                echo "Starting \"/sbin/portmap\""
                loadproc /sbin/portmap
                echo "Starting \"/usr/sbin/rpc.mountd\""
		loadproc /usr/sbin/rpc.mountd
                echo "Starting \"/usr/sbin/rpc.nfsd 8\""
		loadproc /usr/sbin/rpc.nfsd 8
		mount -a -t nfs
                echo "Starting \"/usr/sbin/rpc.statd\""
		loadproc /usr/sbin/rpc.statd
                ;;

        stop)
                echo "Stopping \"/usr/sbin/rpc.nfsd 8\""
		killproc /usr/sbin/rpc.nfsd
                echo "Stopping \"/usr/sbin/rpc.mountd\""
		killproc /usr/sbin/rpc.mountd
                echo "Stopping \"/sbin/portmap\""
                killproc /sbin/portmap
                ;;

        restart)
                $0 stop
                /bin/sleep 1
                $0 start
                ;;

        *)
                echo "Usage: $0 {start|stop|restart}"
                exit 1
        ;;

esac

#  End /etc/rc.d/init.d/nfsserv
EOF


chmod 754 /etc/rc.d/init.d/nfsserv &&

cd /etc/rc.d/init.d &&

ln -sf ../init.d/nfsserv ../rc0.d/K49nfsserv &&

ln -sf ../init.d/nfsserv ../rc1.d/K49nfsserv &&

ln -sf ../init.d/nfsserv ../rc2.d/K49nfsserv &&

ln -sf ../init.d/nfsserv ../rc3.d/S22nfsserv &&

ln -sf ../init.d/nfsserv ../rc4.d/S22nfsserv &&

ln -sf ../init.d/nfsserv ../rc5.d/S22nfsserv &&

ln -sf ../init.d/nfsserv ../rc6.d/K49nfsserv


If you have corrections (on possible errors) or ideas for
improvements (needed and welcome) on this script, or if there is
information I missed to give or other concerns in regard, pls. send
your email to:
	m.rovis[at]inet.hr
as I am not currently subscribed to the mailing list.
You may even not get a reply from me so promptly, as one of my LFS
boxes is fledgling and the other only planned on at this time (I am
on ethernet link with another temporary linux distro) and do not
have mail at hand all the time.
I also take this opportunity to thank the masters/teachers/peers
at the great Linux From Scratch!
Miroslav Rovis,
Zagreb, Croatia
www.exDeo.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org

iD8DBQFAO8Ml5NaGZVDan0oRAreYAKCT9cgsxkhSlPOajxChhFVO7ECz4ACePDaL
wyvmB0Gvx+J05ZSIz8Ano/Y=
=YMzl
-----END PGP SIGNATURE-----




More information about the lfs-support mailing list