slitaz-boot-scripts diff etc/init.d/rc.functions @ rev 122

rcS: log root switching too
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 14 10:30:10 2008 +0000 (2008-11-14)
parents 58cc6775e0f0
children 31520720987c
line diff
     1.1 --- a/etc/init.d/rc.functions	Sat Jul 19 06:54:49 2008 +0000
     1.2 +++ b/etc/init.d/rc.functions	Fri Nov 14 10:30:10 2008 +0000
     1.3 @@ -25,3 +25,14 @@
     1.4  	done
     1.5  	echo "$CHAR"
     1.6  }
     1.7 +
     1.8 +# Check daemon with pidfile: usage check_pidfile $PIDFILE $DAEMON
     1.9 +active_pidfile()
    1.10 +{
    1.11 +	if grep -qs "Name:.$(basename $2)$" /proc/$(cat $1)/status ; then
    1.12 +		return 0
    1.13 +	else
    1.14 +		rm -f $1
    1.15 +		return 1
    1.16 +	fi
    1.17 +}