Permalink
Browse files

Merge https://github.com/golubtsov/Fastcgi-Daemon

Conflicts:
	debian/changelog
  • Loading branch information...
2 parents b77d0fc + 75bf27d commit 1ae70245e6ffd5f0dfed3489d8879849c96d53fa @avm avm committed Sep 14, 2012
Showing with 28 additions and 9 deletions.
  1. +6 −0 debian/changelog
  2. +22 −9 extra/fastcgi-daemon2
View
@@ -1,3 +1,9 @@
+fastcgi-daemon2 (2.10-13) unstable; urgency=low
+
+ * Added correct stop for daemon with delay (by ekilimchuk@).
+
+ -- Alexander Myltsev <myltsev@yandex-team.ru> Wed, 29 Aug 2012 15:46:27 +0400
+
fastcgi-daemon2 (2.10-12) unstable; urgency=low
* added --daemon option
View
@@ -98,15 +98,28 @@ stop() {
continue
fi
echo "Name: $FASTCGI"
- #Kill fastcgistart
- start-stop-daemon --quiet --stop --signal 0 --pidfile $PID_DIR/fastcgistart2.$FASTCGI.pid 2>&1 >/dev/null
- start-stop-daemon --quiet --signal 15 --stop --pidfile $PID_DIR/fastcgistart2.$FASTCGI.pid 2>&1 >/dev/null
- start-stop-daemon --quiet --signal 9 --stop --pidfile $PID_DIR/fastcgistart2.$FASTCGI.pid 2>&1 >/dev/null
- #Kill daemon
- start-stop-daemon --quiet --stop --signal 0 --pidfile $PID_DIR/$FASTCGI.pid 2>&1 >/dev/null
- start-stop-daemon --quiet --signal 15 --stop --pidfile $PID_DIR/$FASTCGI.pid 2>&1 >/dev/null
- sleep $DELAY
- start-stop-daemon --quiet --signal 9 --stop --pidfile $PID_DIR/$FASTCGI.pid 2>&1 >/dev/null
+
+ if start-stop-daemon --quiet --stop --signal 0 --pidfile $PID_DIR/fastcgistart2.$FASTCGI.pid 2>&1 >/dev/null || start-stop-daemon --quiet --stop --signal 0 --pidfile $PID_DIR/$FASTCGI.pid 2>&1 >/dev/null; then
+ start-stop-daemon --quiet --signal 15 --stop --pidfile $PID_DIR/fastcgistart2.$FASTCGI.pid 2>&1 >/dev/null
+ start-stop-daemon --quiet --signal 15 --stop --pidfile $PID_DIR/$FASTCGI.pid 2>&1 >/dev/null
+ for i in `seq 1 30`; do
+ if start-stop-daemon --quiet --stop --signal 0 --pidfile $PID_DIR/fastcgistart2.$FASTCGI.pid 2>&1 >/dev/null || start-stop-daemon --quiet --stop --signal 0 --pidfile $PID_DIR/$FASTCGI.pid 2>&1 >/dev/null; then
+ kill9=1
+ echo -n "."
+ sleep 1
+ else
+ kill9=0
+ break
+ fi
+ done
+ if [ $kill9 -ne 0 ]; then
+ start-stop-daemon --quiet --signal 9 --stop --pidfile $PID_DIR/fastcgistart2.$FASTCGI.pid 2>&1 >/dev/null
+ start-stop-daemon --quiet --signal 9 --stop --pidfile $PID_DIR/$FASTCGI.pid 2>&1 >/dev/null
+ echo "Sended kill -9"
+ fi
+ else
+ echo "Stoped."
+ fi
echo "Stopping $FASTCGI done"
if [ "x$1" = "x" ]; then
if [ -x $POSTSTOP_DIR/$FASTCGI.sh ]; then

0 comments on commit 1ae7024

Please sign in to comment.