cvs commit: LFS/bootscripts/lfs/init.d functions

nathan at linuxfromscratch.org nathan at linuxfromscratch.org
Tue May 4 15:35:31 PDT 2004


nathan      04/05/04 16:35:31

  Modified:    bootscripts CHANGELOG
               bootscripts/lfs/init.d functions
  Log:
  Added the option to use a PIDFILE, if the script creator wishes.
  
  Revision  Changes    Path
  1.69      +2 -1      LFS/bootscripts/CHANGELOG
  
  Index: CHANGELOG
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/CHANGELOG,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- CHANGELOG	4 May 2004 22:25:48 -0000	1.68
  +++ CHANGELOG	4 May 2004 22:35:31 -0000	1.69
  @@ -1,11 +1,12 @@
   n/a - May 4, 2004
   
   	* Update to the console script, prevent install of the console script
  -	* chgrp's udev, /var/run/udev, if udev is a valid group, suggested by
  +	* chgrp's udev, /var/run/utmp, if utmp is a valid group, suggested by
   	  Zack
   	* Moved udev from contrib to lfs
   	* Moved GATEWAY setup from /etc/rc.d/init.d/network to
   	  /etc/sysconfig/network-devices/services/static
  +	* Use the contents of $PIDFILE, if it is set in the script
   
   n/a - April 30, 2004
   
  
  
  
  1.7       +15 -3     LFS/bootscripts/lfs/init.d/functions
  
  Index: functions
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/lfs/init.d/functions,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- functions	31 Mar 2004 21:45:51 -0000	1.6
  +++ functions	4 May 2004 22:35:31 -0000	1.7
  @@ -155,7 +155,11 @@
                   exit 1
           fi
   
  -        getpids $1
  +	if [ -n $PIDFILE -a -r $PIDFILE ]; then
  +		pidlist=`cat $PIDFILE`
  +	else
  +		getpids $1
  +	fi
   
           if [ -z "$pidlist" ]
           then
  @@ -184,7 +188,11 @@
                   fallback=""
           fi
   
  -        getpids $1
  +	if [ -n $PIDFILE -a -r $PIDFILE ]; then
  +		pidlist=`cat $PIDFILE`
  +	else
  +		getpids $1
  +	fi
   
           if [ -n "$pidlist" ]; then
                   local i=0
  @@ -212,7 +220,11 @@
   			failure=1
   		else
   			failure=0
  -			rm -f /var/run/$base.pid
  +			if [ ! -z $PIDFILE ]; then
  +				rm -f $PIDFILE
  +			else
  +				rm -f /var/run/$base.pid
  +			fi
   		fi
   
                   (exit $failure)
  
  
  



More information about the lfs-book mailing list