slitaz-boot-scripts rev 121
Add active_pidfile in rc.functions
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Oct 31 11:05:55 2008 +0000 (2008-10-31) |
parents | c808d94cb65d |
children | 992e3ee958ad |
files | etc/init.d/rc.functions |
line diff
1.1 --- a/etc/init.d/rc.functions Thu Oct 23 20:54:35 2008 +0000 1.2 +++ b/etc/init.d/rc.functions Fri Oct 31 11:05:55 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 +}