cvs commit: LFS/bootscripts/blfs/init.d adsl alsa apache bind cups dhcp exim fcron gdm gpm lprng mysql netfs nfs-client nfs-server ntp portmap postfix postgresql proftpd random rsyncd samba sendmail sshd xinetd

nathan at linuxfromscratch.org nathan at linuxfromscratch.org
Fri Mar 19 16:10:23 PST 2004


nathan      04/03/19 17:10:23

  Modified:    bootscripts CHANGELOG
  Added:       bootscripts/blfs/init.d adsl alsa apache bind cups dhcp exim
                        fcron gdm gpm lprng mysql netfs nfs-client
                        nfs-server ntp portmap postfix postgresql proftpd
                        random rsyncd samba sendmail sshd xinetd
  Log:
  Added BLFS bootscripts to tarball.  Took off the 2.0.0 target, as it was
  done too early.
  
  Revision  Changes    Path
  1.30      +2 -2      LFS/bootscripts/CHANGELOG
  
  Index: CHANGELOG
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/CHANGELOG,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- CHANGELOG	19 Mar 2004 22:08:29 -0000	1.29
  +++ CHANGELOG	20 Mar 2004 00:10:22 -0000	1.30
  @@ -1,11 +1,11 @@
  -2.0.0 - March 19, 2004
  +n/a - March 19, 2004
   
   	* Renamed mountproc to mountkernfs
   	* Updated the README file
   	* Coloured the print_error_message in functions red
   	* added stop to the setclock script
   	* changed echo > to > in cleanfs, suggested by winkie
  -	* Tagged as release 2.0.0
  +	* Initial additions of some BLFS Scripts
   
   1.99.4 - March 17, 2004
   
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/adsl
  
  Index: adsl
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/adsl
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  # adsl script written by DJ Lucas  - dj at lucasit.com
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Bringing up the ADSL interface..."
  		/usr/sbin/adsl-start
  		evaluate_retval
  		;;
  
  	stop)
  		echo "Bringing down the ADSL interface..."
  		/usr/sbin/adsl-stop
  		evaluate_retval
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		/usr/sbin/adsl-status
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/adsl
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/alsa
  
  Index: alsa
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/alsa
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  # ALSA specific parts by Mark Hymers - markh at linuxfromscratch.org
  # Stores mixer settings in the default location: /etc/asound.state
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting ALSA...    Restoring volumes..."
  		loadproc /usr/sbin/alsactl restore
  		#echo "                    Loading MIDI font..."
  		#loadproc sfxload /path/to/soundfont
  		;;
  
  	stop)
  		echo "Stopping ALSA...    Saving volumes..."
  		loadproc /usr/sbin/alsactl store
  		#echo "                    Removing MIDI font..."
  		#loadproc sfxload -i
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/alsa
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/apache
  
  Index: apache
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/apache
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting Apache daemon..."
  		/usr/sbin/apachectl -k start
  		evaluate_retval
  		;;
  
  	stop)
  		echo "Stopping Apache daemon..."
  		/usr/sbin/apachectl -k stop
  		evaluate_retval
  		;;
  
  	restart)
  		echo "Restarting Apache daemon..."
  		/usr/sbin/apachectl -k restart
  		evaluate_retval
  		;;
  
  	status)
  		statusproc /usr/sbin/httpd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/apache
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/bind
  
  Index: bind
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/bind
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting named..."
  		loadproc /usr/sbin/named -u named -t /home/named -c \
  			/etc/named.conf
  		;;
  
  	stop)
  		echo "Stopping named..."
  		killproc /usr/sbin/named
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	reload)
  		echo "Reloading named..."
  		/usr/sbin/rndc -c /etc/rndc.conf reload
  		;;
  
  	status)
  		statusproc /usr/sbin/named
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/bind
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/cups
  
  Index: cups
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/cups
  
  # Start or stop the CUPS server based upon the first argument to the script.
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case $1 in
  	start)
  		echo "Starting CUPS Printserver..."
  		loadproc /usr/sbin/cupsd
  		;;
  
  	stop)
  		echo "Stopping CUPS Printserver..."
  		killproc cupsd
  		;;
  
  	reload)
  		echo "Reloading CUPS Printserver..."
  		reloadproc /usr/sbin/cupsd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc cupsd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/cups
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/dhcp
  
  Index: dhcp
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/dhcp
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting DHCP Server..."
  		loadproc dhcpd -q eth1
  		;;
  
  	stop)
  		echo "Stopping DHCP Server..."
  		killproc dhcpd
  		;;
  
  	reload)
  		echo "Reloading DHCP Server..."
  		reloadproc dhcpd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc dhcpd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/dhcp
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/exim
  
  Index: exim
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/exim
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting exim..."
  		loadproc /usr/sbin/exim -bd -q1m
  		;;
  
  	stop)
  		echo "Stopping exim..."
  		killproc exim
  		;;
  
  	status)
  		statusproc exim
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|status|restart}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/exim
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/fcron
  
  Index: fcron
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/fcron
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting fcron..."
  		loadproc fcron
  		;;
  
  	stop)
  		echo "Stopping fcron..."
  		killproc fcron
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc fcron
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/fcron
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/gdm
  
  Index: gdm
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/gdm
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting GDM..."
  		loadproc /opt/gnome-2.4/bin/gdm
  		;;
  
  	stop)
  		echo "Stopping GDM..."
  		if [ -f /var/run/gdm.pid ]; then
  			loadproc /opt/gnome-2.4/sbin/gdm-stop
  		fi
  		;;
  
  	reload)
  		echo "Reloading GDM..."
  		reloadproc /opt/gnome-2.4/sbin/gdm-safe-restart
  		;;
  
  	restart)
  		echo "Restarting GDM..."
  		loadproc /opt/gnome-2.4/sbin/gdm-restart
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/gdm
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/gpm
  
  Index: gpm
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/gpm
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  # GPM specific parts by Mark Hymers - markh at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  if [ -f /etc/sysconfig/mouse ]
  	then
  	. /etc/sysconfig/mouse
  fi
  
  if [ -z "$MDEVICE" ] || [ -z "$PROTOCOL" ]
  	then
  	echo "Please create an /etc/sysconfig/mouse file containing"
  	echo "MDEVICE and PROTOCOL values"
  	exit 1;
  fi
  
  case "$1" in
  	start)
  		echo "Starting gpm..."
  		loadproc gpm -m $MDEVICE -t $PROTOCOL
  		;;
  
  	stop)
  		echo "Stopping gpm..."
  		killproc gpm
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc gpm
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/gpm
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/lprng
  
  Index: lprng
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/lprng
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting lpd..."
  		loadproc /usr/sbin/lpd
  		;;
  
  	stop)
  		echo "Stopping lpd..."
  		killproc /usr/sbin/lpd
  		;;
  
  	reload)
  		echo "Reloading lpd..."
  		reloadproc /usr/sbin/lpd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/lpd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/lprng
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/mysql
  
  Index: mysql
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/mysql
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  pid_file=/var/lib/mysql/`/bin/hostname`.pid
  
  case "$1" in
  	start)
  		echo "Starting MySQL daemon..."
  		failure=0
  		if test -f "$pid_file"
  		then
  			if /bin/ps p `cat $pid_file` | grep mysqld >/dev/null
  			then
  				print_status warning running
  				exit 0
  			else
  				rm -f $pid_file
  				if test -f $pid_file
  				then
  					failure=1
  				fi
  			fi
  		fi
  		if [ $failure = 1 ]
  		then
  			print_status failure
  		else
  			/usr/bin/mysqld_safe --user=mysql 2>&1 >/dev/null &
  			evaluate_retval
  		fi
  		;;
  
  	stop)
  		echo "Stopping MySQL daemon..."
  		if test -s "$pid_file"
  		then
  			kill `cat $pid_file`
  			sleep 1
  			failure=0
  			while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
  			do
  				[ -z "$flags" ]
  				flags=a$flags
  				sleep 1
  			done
  			if [ -s $pid_file ]
  				then failure=1
  			fi
  			(exit $failure)
  			evalate_retval
  		else
  			print_status warning not_running
  		fi
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/mysqld
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/mysql
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/netfs
  
  Index: netfs
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/netfs
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  # netfs script written by Nathan Coulson - conathan at conet.dyndns.org
  # and by DJ Lucas - dj at lucasit.com
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		# The following line mounts all entries in fstab that
  		# have the _netdev option.  This is required for network
  		# filesystems to be mounted at boot time.
  		echo "Mounting network volumes..."
  		mount -a -O _netdev
  		evaluate_retval
  		;;
  
  	stop)
  		echo -n "Unmounting network volumes..."
  
  		# The following line obtains a list from the output of
  		# mount for all netfs types and anything that was
  		# mounted with the _netdev option.
  		NETMOUNTS=`mount | grep '_netdev\|smbfs\|ncpfs|\coda\|nfs' \
  			| cut -d " " -f 3 | sed 's/$/ /g'`
  
  		# Check to see if anything was listed from above
  		# (see if anything is actually needs to be unmounted)
  		if [ x"$NETMOUNTS" != x ]
  		then
  			# There is something mounted
  			# terminate the echo -n above
  			echo " "
  
  			# Try and stop processes the nice way
  			# (probably won't work in most cases)
  			fuser -m -SIGTERM $NETMOUNTS > /dev/null
  
  			# Check and see if it found anything.  If it
  			# did, then give 3 seconds for things to exit
  			# the nice way before killing them off.
  			# This one will work all of the time!
  			if [ $? == 0 ]
  			then
  				sleep 3
  				fuser -km $NETMOUNTS > /dev/null
  			fi
  
  			# We now need to unmount all network filesystems.
  			# We will do this with two umount commands to allow
  			# for broken behavior of smbmount, and also to make
  			# certain that netmounts without the _netdev option
  			# will still get unmounted.
  			umount -a -O _netdev
  			# save the retval
  			if [ $? != 0 ]
  			then
  				NERRVAL=1
  			fi
  
  			# Now catch the rest of the network filesystems
  			# by fstype.  This list can be extended later as
  			# more network filesystems are supported by mount.
  			umount -a -t coda,ncpfs,nfs,smbfs
  			if [ $? == 0]
  			then
  				[ -z $NERRVAL ]
  				evaluate_retval
  			else
  				# make certain that we return an error
  				/bin/false              
  				evaluate_retval
  			fi
  		else
  			# There is nothing mounted
  			echo "No network volumes mounted!"
  			# print a nice '[  OK  ]' message
  			evaluate_retval
  		fi
  		;;
  
  *)
                  echo "Usage: $0 {start|stop}"
                  exit 1
                  ;;
  esac
  
  # End $rc_base/init.d/netfs
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/nfs-client
  
  Index: nfs-client
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/nfs-client
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Mounting NFS Partitions..."
  		loadproc /usr/sbin/rpc.statd
  		loadproc /usr/sbin/rpc.lockd
  		mount -a -t nfs
  		;;
  
  	stop)
  		echo "Unmounting NFS Partitions..."
  		umount -a -t nfs
  		killproc /usr/sbin/rpc.lockd
  		killproc /usr/sbin/rpc.statd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/rpc.statd
  		statusproc /usr/sbin/rpc.lockd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/nfs-client
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/nfs-server
  
  Index: nfs-server
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/nfs-server
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting NFS Server..."
  		loadproc /usr/sbin/rpc.mountd
  		loadproc /usr/sbin/rpc.nfsd 8
  		loadproc /usr/sbin/rpc.statd
  		;;
  
  	stop)
  		echo "Stopping NFS Server..."
  		killproc /usr/sbin/rpc.nfsd
  		killproc /usr/sbin/rpc.mountd
  		;;
  
  	reload)
  		echo "Reloading NFS Server..."
  		/usr/sbin/exportfs -ra
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/rpc.mountd
  		statusproc /usr/sbin/rpc.nfsd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/nfs-server
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/ntp
  
  Index: ntp
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/ntp
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting ntpd..."
  		loadproc ntpd
  		;;
  
  	stop)
  		echo "Stopping ntpd..."
  		killproc ntpd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc ntpd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/ntp
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/portmap
  
  Index: portmap
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/portmap
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting RPC Portmap"
  		loadproc /sbin/portmap
  		;;
  
  	stop)
  		echo "Stopping Portmap"
  		killproc /sbin/portmap
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart}"
  		exit 1
  		;;
  
  esac
  
  # End $rc_base/init.d/portmap
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/postfix
  
  Index: postfix
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/postfix
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting Postfix..."
  		loadproc postfix start
  		;;
  
  	stop)
  		echo "Stopping Postfix..."
  		loadproc postfix stop
  		;;
  
  	reload)
  		echo "Reloading Postfix..."
  		loadproc postfix reload
  		;;
  
  	abort)
  		echo "Aborting Postfix..."
  		loadproc postfix abort
  		;;
  
  	flush)
  		echo "Flushing Postfix..."
  		loadproc postfix flush
  		;;
  
  	check)
  		echo "Checking Postfix..."
  		loadproc postfix check
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|abort|flush|check|restart}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/postfix
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/postgresql
  
  Index: postgresql
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/postgresql
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting PostgreSQL daemon..."
  		su - postgres -c '/usr/bin/pg_ctl start -W -D /var/pgsql/data \
  				-l /var/pgsql/data/logfile -o "-i" '
  		evaluate_retval
  		;;
  
  	stop)
  		echo "Stopping PostgreSQL daemon..."
  		/usr/bin/pg_ctl stop -m smart -D /var/pgsql/data
  		evaluate_retval
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		/usr/bin/pg_ctl status -D /var/pgsql/data
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/postgresql
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/proftpd
  
  Index: proftpd
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/proftpd
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting FTP Server..."
  		loadproc /usr/sbin/proftpd
  		;;
  
  	stop)
  		echo "Stopping FTP Server..."
  		killproc /usr/sbin/proftpd
  		;;
  
  	reload)
  		echo "Reloading FTP Server..."
  		reloadproc /usr/sbin/proftpd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/proftpd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/proftpd
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/random
  
  Index: random
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/random
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  # Random script elements by Larry Lawrence
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Initializing kernel random number generator..."
  		if [ -f /var/tmp/random-seed ]; then
  			cat /var/tmp/random-seed >/dev/urandom
  		fi
  		dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
  		evaluate_retval
  		;;
                  
  	stop)
  		echo "Saving random seed..."
  		dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
  		evaluate_retval
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/random
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/rsyncd
  
  Index: rsyncd
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/rsyncd
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting RSYNC Server..."
  		loadproc /usr/bin/rsync --daemon --compress
  		;;
  
  	stop)
  		echo "Stopping RSYNC Server..."
  		killproc /usr/bin/rsync
  		;;
  
  	reload)
  		echo "Reloading RSYNC Server..."
  		reloadproc /usr/bin/rsync
  		;;
              
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/bin/rsync
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/rsyncd
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/samba
  
  Index: samba
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/samba
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting nmbd..."
  		loadproc /usr/sbin/nmbd -D
  
  		echo "Starting smbd..."
  		loadproc /usr/sbin/smbd -D
  		;;
  
  	stop)
  		echo "Stopping smbd..."
  		killproc /usr/sbin/smbd
  
  		echo "Stopping nmbd..."
  		killproc /usr/sbin/nmbd
                  ;;
  
  	reload)
  		echo "Reloading smbd..."
  		reloadproc /usr/sbin/smbd
  
  		echo "Reloading nmbd..."
  		reloadproc /usr/sbin/nmbd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/nmbd
  		statusproc /usr/sbin/smbd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/samba
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/sendmail
  
  Index: sendmail
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/sendmail
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting sendmail..."
  		loadproc /usr/sbin/sendmail -bs -bd -q5m start
  		;;
  
  	stop)
  		echo "Stopping Sendmail..."
  		killproc sendmail
  		;;
  
  	status)
  		statusproc sendmail
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|status|restart}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/sendmail
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/sshd
  
  Index: sshd
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/sshd
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting SSH Server..."
  		loadproc /usr/sbin/sshd
  		;;
  
  	stop)
  		echo "Stopping SSH Server..."
  		killproc /usr/sbin/sshd
  		;;
  
  	reload)
  		echo "Reloading SSH Server..."
  		reloadproc /usr/sbin/sshd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/sshd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/sshd
  
  
  
  1.1                  LFS/bootscripts/blfs/init.d/xinetd
  
  Index: xinetd
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/xinetd
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  . /etc/sysconfig/rc
  . $rc_functions
  
  case "$1" in
  	start)
  		echo "Starting xinetd..."
  		loadproc /usr/sbin/xinetd
  		;;
  
  	stop)
  		echo "Stopping xinetd..."
  		killproc /usr/sbin/xinetd
  		;;
  
  	reload)
  		echo "Reloading xinetd..."
  		killall -HUP xinetd
  		;;
  
  	restart)
  		$0 stop
  		sleep 1
  		$0 start
  		;;
  
  	status)
  		statusproc /usr/sbin/xinetd
  		;;
  
  	*)
  		echo "Usage: $0 {start|stop|reload|restart|status}"
  		exit 1
  		;;
  esac
  
  # End $rc_base/init.d/xinetd
  
  
  



More information about the lfs-book mailing list