[pve-devel] r5637 - pve-manager/pve2/bin/init.d

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Mar 3 07:12:51 CET 2011


Author: dietmar
Date: 2011-03-03 07:12:51 +0100 (Thu, 03 Mar 2011)
New Revision: 5637

Modified:
   pve-manager/pve2/bin/init.d/pvedaemon
Log:
cleanup script, wait after last kill


Modified: pve-manager/pve2/bin/init.d/pvedaemon
===================================================================
--- pve-manager/pve2/bin/init.d/pvedaemon	2011-03-03 05:42:49 UTC (rev 5636)
+++ pve-manager/pve2/bin/init.d/pvedaemon	2011-03-03 06:12:51 UTC (rev 5637)
@@ -6,13 +6,15 @@
 # Required-Stop:   $remote_fs $network $syslog pve-cluster
 # Default-Start:   2 3 4 5
 # Default-Stop:    0 1 6
-# Short-Description: Start PVE Daemon
+# Short-Description: PVE Daemon
 ### END INIT INFO
 
 . /lib/lsb/init-functions
 
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
 DAEMON=/usr/bin/pvedaemon
+NAME=pvedaemon
+DESC="PVE Daemon"
 PIDFILE=/var/run/pvedaemon.pid
 
 test -f $DAEMON || exit 0
@@ -22,17 +24,17 @@
 
 case "$1" in
 	start)
-		log_daemon_msg "Starting PVE daemon" "pvedaemon"
+		log_daemon_msg "Starting $DESC" "$NAME"
   		start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
 		log_end_msg $?
   		;;
 	stop)
-		log_daemon_msg "Stopping PVE daemon" "pvedaemon"
-  		start-stop-daemon --stop --quiet --retry TERM/2/TERM/10/KILL --pidfile $PIDFILE
+		log_daemon_msg "Stopping $DESC" "$NAME"
+  		start-stop-daemon --stop --quiet --retry TERM/2/TERM/10/KILL/2 --pidfile $PIDFILE
 		log_end_msg $?
   		;;
 	reload)
-		log_daemon_msg "Reloading PVE daemon configuration" "pvedaemon"
+		log_daemon_msg "Reloading $DESC" "$NAME"
 		if ( [ -e $PIDFILE ] && kill -0 `cat $PIDFILE`) then
 		    start-stop-daemon --stop --signal HUP --pidfile $PIDFILE
 		else
@@ -41,14 +43,15 @@
 		log_end_msg $?
   		;;		
 	restart|force-reload)
-		log_daemon_msg "Restarting PVE daemon" "pvedaemon"
-  		start-stop-daemon --stop --quiet --retry TERM/2/TERM/10/KILL --pidfile $PIDFILE
+		log_daemon_msg "Restarting $DESC" "$NAME"
+  		start-stop-daemon --stop --quiet --retry TERM/2/TERM/10/KILL/2 --pidfile $PIDFILE
                 sleep 2
   		start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
 		log_end_msg $?
   		;;
 	*)
-  		echo "Usage: /etc/init.d/pvedaemon {start|stop|restart|force-reload}"
+	        N=/etc/init.d/$NAME
+  		echo "Usage: $N {start|stop|restart|force-reload}"
   		exit 1
 		;;
 esac



More information about the pve-devel mailing list