wok rev 6170
apache, chillispot, knock, openerp-server, openssh, portmap, smartmontools, squid, unfs3: use active_pidfile function in start script
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Sep 10 16:25:17 2010 +0200 (2010-09-10) |
parents | e5b2f931007b |
children | 1093eb8937ed |
files | apache/stuff/apache chillispot/stuff/chilli knock/stuff/etc/init.d/knock openerp-server/stuff/etc/init.d/openerp-server openssh/stuff/openssh portmap/stuff/init.d/portmap smartmontools/stuff/etc/init.d/smartd squid/stuff/etc/init.d/squid unfs3/stuff/etc/init.d/unfsd |
line diff
1.1 --- a/apache/stuff/apache Fri Sep 10 11:07:52 2010 +0000 1.2 +++ b/apache/stuff/apache Fri Sep 10 16:25:17 2010 +0200 1.3 @@ -14,7 +14,7 @@ 1.4 1.5 case "$1" in 1.6 start) 1.7 - if [ -f $PIDFILE ] ; then 1.8 + if active_pidfile $PIDFILE httpd ; then 1.9 echo "$NAME already running." 1.10 exit 1 1.11 fi 1.12 @@ -23,7 +23,7 @@ 1.13 status 1.14 ;; 1.15 stop) 1.16 - if [ ! -f $PIDFILE ] ; then 1.17 + if ! active_pidfile $PIDFILE httpd ; then 1.18 echo "$NAME is not running." 1.19 exit 1 1.20 fi 1.21 @@ -33,7 +33,7 @@ 1.22 status 1.23 ;; 1.24 reload) 1.25 - if [ ! -f $PIDFILE ] ; then 1.26 + if ! active_pidfile $PIDFILE httpd ; then 1.27 echo "$NAME is not running." 1.28 exit 1 1.29 fi 1.30 @@ -42,7 +42,7 @@ 1.31 status 1.32 ;; 1.33 restart) 1.34 - if [ ! -f $PIDFILE ] ; then 1.35 + if ! active_pidfile $PIDFILE httpd ; then 1.36 echo "$NAME is not running." 1.37 exit 1 1.38 fi
2.1 --- a/chillispot/stuff/chilli Fri Sep 10 11:07:52 2010 +0000 2.2 +++ b/chillispot/stuff/chilli Fri Sep 10 16:25:17 2010 +0200 2.3 @@ -17,7 +17,7 @@ 2.4 2.5 case "$1" in 2.6 start) 2.7 - if [ -f $PIDFILE ] ; then 2.8 + if active_pidfile $PIDFILE chilli ; then 2.9 echo "$NAME already running." 2.10 exit 1 2.11 fi 2.12 @@ -25,7 +25,7 @@ 2.13 status 2.14 ;; 2.15 stop) 2.16 - if [ ! -f $PIDFILE ] ; then 2.17 + if ! active_pidfile $PIDFILE chilli ; then 2.18 echo "$NAME is not running." 2.19 exit 1 2.20 fi 2.21 @@ -34,7 +34,7 @@ 2.22 status 2.23 ;; 2.24 restart) 2.25 - if [ ! -f $PIDFILE ] ; then 2.26 + if ! active_pidfile $PIDFILE chilli ; then 2.27 echo "$NAME is not running." 2.28 exit 1 2.29 fi
3.1 --- a/knock/stuff/etc/init.d/knock Fri Sep 10 11:07:52 2010 +0000 3.2 +++ b/knock/stuff/etc/init.d/knock Fri Sep 10 16:25:17 2010 +0200 3.3 @@ -17,7 +17,7 @@ 3.4 3.5 case "$1" in 3.6 start) 3.7 - if [ -f $PIDFILE ] ; then 3.8 + if active_pidfile $PIDFILE knockd ; then 3.9 echo "$NAME already running." 3.10 exit 1 3.11 fi 3.12 @@ -26,7 +26,7 @@ 3.13 status 3.14 ;; 3.15 stop) 3.16 - if [ ! -f $PIDFILE ] ; then 3.17 + if ! active_pidfile $PIDFILE knockd ; then 3.18 echo "$NAME is not running." 3.19 exit 1 3.20 fi 3.21 @@ -35,7 +35,7 @@ 3.22 status 3.23 ;; 3.24 restart) 3.25 - if [ ! -f $PIDFILE ] ; then 3.26 + if ! active_pidfile $PIDFILE knockd ; then 3.27 echo "$NAME is not running." 3.28 exit 1 3.29 fi
4.1 --- a/openerp-server/stuff/etc/init.d/openerp-server Fri Sep 10 11:07:52 2010 +0000 4.2 +++ b/openerp-server/stuff/etc/init.d/openerp-server Fri Sep 10 16:25:17 2010 +0200 4.3 @@ -25,7 +25,7 @@ 4.4 4.5 case "$1" in 4.6 start) 4.7 - if [ -f "$PIDFILE" ]; then 4.8 + if active_pidfile $PIDFILE python ; then 4.9 echo "$NAME already running (PID: `cat $PIDFILE`)." 4.10 exit 1 4.11 fi 4.12 @@ -34,12 +34,12 @@ 4.13 status 4.14 sleep 4 4.15 # At boot OpenERP dont start correctly if we start it in background. 4.16 - if [ ! -f "$PIDFILE" ]; then 4.17 + if ! active_pidfile $PIDFILE python ; then 4.18 sleep 6 4.19 $DAEMON $OPTIONS > $LOGFILE 4.20 fi ;; 4.21 stop) 4.22 - if [ ! -f "$PIDFILE" ]; then 4.23 + if ! active_pidfile $PIDFILE python ; then 4.24 echo "$NAME is not running." 4.25 exit 1 4.26 fi
5.1 --- a/openssh/stuff/openssh Fri Sep 10 11:07:52 2010 +0000 5.2 +++ b/openssh/stuff/openssh Fri Sep 10 16:25:17 2010 +0200 5.3 @@ -25,7 +25,7 @@ 5.4 echo "Generating $NAME dsa key... " 5.5 ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -C '' -N '' 5.6 fi 5.7 - if [ -f $PIDFILE ] ; then 5.8 + if active_pidfile $PIDFILE sshd ; then 5.9 echo "$NAME already running." 5.10 exit 1 5.11 fi 5.12 @@ -34,7 +34,7 @@ 5.13 status 5.14 ;; 5.15 stop) 5.16 - if [ ! -f $PIDFILE ] ; then 5.17 + if ! active_pidfile $PIDFILE sshd ; then 5.18 echo "$NAME is not running." 5.19 exit 1 5.20 fi 5.21 @@ -43,7 +43,7 @@ 5.22 status 5.23 ;; 5.24 restart) 5.25 - if [ ! -f $PIDFILE ] ; then 5.26 + if ! active_pidfile $PIDFILE sshd ; then 5.27 echo "$NAME is not running." 5.28 exit 1 5.29 fi
6.1 --- a/portmap/stuff/init.d/portmap Fri Sep 10 11:07:52 2010 +0000 6.2 +++ b/portmap/stuff/init.d/portmap Fri Sep 10 16:25:17 2010 +0200 6.3 @@ -19,7 +19,7 @@ 6.4 6.5 case "$1" in 6.6 start) 6.7 - if [ -f $PIDFILE ] ; then 6.8 + if active_pidfile $PIDFILE portmap ; then 6.9 echo "$NAME already running." 6.10 exit 1 6.11 fi 6.12 @@ -43,7 +43,7 @@ 6.13 6.14 ;; 6.15 stop) 6.16 - if [ ! -f $PIDFILE ] ; then 6.17 + if ! active_pidfile $PIDFILE portmap ; then 6.18 echo "$NAME is not running." 6.19 exit 1 6.20 fi
7.1 --- a/smartmontools/stuff/etc/init.d/smartd Fri Sep 10 11:07:52 2010 +0000 7.2 +++ b/smartmontools/stuff/etc/init.d/smartd Fri Sep 10 16:25:17 2010 +0200 7.3 @@ -17,7 +17,7 @@ 7.4 7.5 case "$1" in 7.6 start) 7.7 - if [ -f $PIDFILE ] ; then 7.8 + if active_pidfile $PIDFILE smartd ; then 7.9 echo "$NAME already running." 7.10 exit 1 7.11 fi 7.12 @@ -26,7 +26,7 @@ 7.13 status 7.14 ;; 7.15 stop) 7.16 - if [ ! -f $PIDFILE ] ; then 7.17 + if ! active_pidfile $PIDFILE smartd ; then 7.18 echo "$NAME is not running." 7.19 exit 1 7.20 fi 7.21 @@ -35,7 +35,7 @@ 7.22 status 7.23 ;; 7.24 restart) 7.25 - if [ ! -f $PIDFILE ] ; then 7.26 + if ! active_pidfile $PIDFILE smartd ; then 7.27 echo "$NAME is not running." 7.28 exit 1 7.29 fi
8.1 --- a/squid/stuff/etc/init.d/squid Fri Sep 10 11:07:52 2010 +0000 8.2 +++ b/squid/stuff/etc/init.d/squid Fri Sep 10 16:25:17 2010 +0200 8.3 @@ -19,7 +19,7 @@ 8.4 8.5 case "$1" in 8.6 start) 8.7 - if [ -f $PIDFILE ] ; then 8.8 + if active_pidfile $PIDFILE squid ; then 8.9 echo "$NAME already running." 8.10 exit 1 8.11 fi 8.12 @@ -36,7 +36,7 @@ 8.13 sleep 2 8.14 ;; 8.15 stop) 8.16 - if [ ! -f $PIDFILE ] ; then 8.17 + if ! active_pidfile $PIDFILE squid ; then 8.18 echo "$NAME is not running." 8.19 exit 1 8.20 fi 8.21 @@ -47,7 +47,7 @@ 8.22 sleep 2 8.23 ;; 8.24 reload) 8.25 - if [ ! -f $PIDFILE ] ; then 8.26 + if ! active_pidfile $PIDFILE squid ; then 8.27 echo "$NAME is not running." 8.28 exit 1 8.29 fi 8.30 @@ -56,7 +56,7 @@ 8.31 status 8.32 ;; 8.33 restart) 8.34 - if [ ! -f $PIDFILE ] ; then 8.35 + if ! active_pidfile $PIDFILE squid ; then 8.36 echo "$NAME is not running." 8.37 exit 1 8.38 fi
9.1 --- a/unfs3/stuff/etc/init.d/unfsd Fri Sep 10 11:07:52 2010 +0000 9.2 +++ b/unfs3/stuff/etc/init.d/unfsd Fri Sep 10 16:25:17 2010 +0200 9.3 @@ -19,7 +19,7 @@ 9.4 9.5 case "$1" in 9.6 start) 9.7 - if [ -f $PIDFILE ] ; then 9.8 + if active_pidfile $PIDFILE unfsd ; then 9.9 echo "$NAME already running." 9.10 exit 1 9.11 fi 9.12 @@ -34,7 +34,7 @@ 9.13 fi 9.14 ;; 9.15 stop) 9.16 - if [ ! -f $PIDFILE ] ; then 9.17 + if ! active_pidfile $PIDFILE unfsd ; then 9.18 echo "$NAME is not running." 9.19 exit 1 9.20 fi