wok diff git/stuff/git-daemon @ rev 24779
thttpd: race condition
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 19 18:08:11 2022 +0000 (2022-03-19) |
parents | 7f188676b59c |
children |
line diff
1.1 --- a/git/stuff/git-daemon Thu May 26 20:16:45 2016 +0300 1.2 +++ b/git/stuff/git-daemon Sat Mar 19 18:08:11 2022 +0000 1.3 @@ -1,8 +1,8 @@ 1.4 #!/bin/sh 1.5 -# /etc/init.d/git-daemon: Start, stop and restart git-daemon daemon on SliTaz, at boot 1.6 -# time or with the command line. 1.7 +# /etc/init.d/git-daemon: Start, stop and restart git daemon on SliTaz, 1.8 +# at boot time or with the command line. 1.9 # 1.10 -# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 1.11 +# To start git daemon at boot time, just put git-daemon in the $RUN_DAEMONS 1.12 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 1.13 # 1.14 . /etc/init.d/rc.functions 1.15 @@ -15,40 +15,43 @@ 1.16 PIDFILE=/var/run/git-daemon.pid 1.17 1.18 case "$1" in 1.19 - start) 1.20 - if active_pidfile $PIDFILE git-daemon ; then 1.21 - _ '%s is already running.' $NAME 1.22 - exit 1 1.23 - fi 1.24 - action 'Starting %s: %s...' "$DESC" $NAME 1.25 - $DAEMON --pid-file=$PIDFILE $OPTIONS 1.26 - status 1.27 - ;; 1.28 - stop) 1.29 - if ! active_pidfile $PIDFILE git-daemon ; then 1.30 - _ '%s is not running.' $NAME 1.31 - exit 1 1.32 - fi 1.33 - action 'Stopping %s: %s...' "$DESC" $NAME 1.34 - kill $(cat $PIDFILE) 1.35 - status 1.36 - ;; 1.37 - restart) 1.38 - if ! active_pidfile $PIDFILE git-daemon ; then 1.39 - _ '%s is not running.' $NAME 1.40 - exit 1 1.41 - fi 1.42 - action 'Restarting %s: %s...' "$DESC" $NAME 1.43 - kill $(cat $PIDFILE) 1.44 - sleep 2 1.45 - $DAEMON $OPTIONS 1.46 - status 1.47 - ;; 1.48 - *) 1.49 - emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.50 - newline 1.51 - exit 1 1.52 - ;; 1.53 + (start) 1.54 + if active_pidfile $PIDFILE $NAME 1.55 + then 1.56 + _ '%s is already running.' $NAME 1.57 + exit 1 1.58 + fi 1.59 + action 'Starting %s: %s...' "$DESC" $NAME 1.60 + $DAEMON --pid-file=$PIDFILE $OPTIONS 1.61 + status 1.62 + ;; 1.63 + (stop) 1.64 + if ! active_pidfile $PIDFILE $NAME 1.65 + then 1.66 + _ '%s is not running.' $NAME 1.67 + exit 1 1.68 + fi 1.69 + action 'Stopping %s: %s...' "$DESC" $NAME 1.70 + kill $(cat $PIDFILE) 1.71 + status 1.72 + ;; 1.73 + (restart) 1.74 + if ! active_pidfile $PIDFILE $NAME 1.75 + then 1.76 + _ '%s is not running.' $NAME 1.77 + exit 1 1.78 + fi 1.79 + action 'Restarting %s: %s...' "$DESC" $NAME 1.80 + kill $(cat $PIDFILE) 1.81 + sleep 2 1.82 + $DAEMON --pid-file=$PIDFILE $OPTIONS 1.83 + status 1.84 + ;; 1.85 + (*) 1.86 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.87 + newline 1.88 + exit 1 1.89 + ;; 1.90 esac 1.91 1.92 exit 0