summaryrefslogtreecommitdiffstats
path: root/debian/bcfg2-server.init
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-07-20 22:17:39 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-07-20 22:17:39 +0000
commitef58e692289049ccf74175dbe242ed48e9e61b2f (patch)
tree3930dbfe9bb195515a49a84bd88db4bbdd07e2ef /debian/bcfg2-server.init
parentaa9a728062db4083699d8c2899e14052d25f2927 (diff)
downloadbcfg2-ef58e692289049ccf74175dbe242ed48e9e61b2f.tar.gz
bcfg2-ef58e692289049ccf74175dbe242ed48e9e61b2f.tar.bz2
bcfg2-ef58e692289049ccf74175dbe242ed48e9e61b2f.zip
Commit of Sami's debian packaging improvements
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1979 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'debian/bcfg2-server.init')
-rw-r--r--debian/bcfg2-server.init50
1 files changed, 29 insertions, 21 deletions
diff --git a/debian/bcfg2-server.init b/debian/bcfg2-server.init
index 8025b72cc..d2d82bd10 100644
--- a/debian/bcfg2-server.init
+++ b/debian/bcfg2-server.init
@@ -5,39 +5,47 @@
# chkconfig: 2345 19 81
# description: bcfg2 server for configuration requests
#
+### BEGIN INIT INFO
+# Provides: bcfg2-server
+# Required-Start: $network
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: S 0 1 6
+# Short-Description: Configuration management Server
+# Description: Bcfg2 is a configuration management system that builds
+# installs configuration files served by bcfg2-server
+### END INIT INFO
-PIDFILE=/var/tmp/bcfg2-server.pid
+DAEMON=/usr/sbin/bcfg2-server
+PIDFILE=/var/run/bcfg2-server.pid
+PARAMS="-D $PIDFILE"
+
+# Exit if $DAEMON doesn't exist and is not executable
+test -x $DAEMON || exit 5
+
+# Include lsb functions
+. /lib/lsb/init-functions
case "$1" in
start)
- echo -n "Starting bcfg2-server: "
- if [ -f "/etc/debian_version" ] ; then
- /sbin/start-stop-daemon --pidfile "${PIDFILE}" --make-pidfile -b -S --startas /usr/sbin/bcfg2-server
- else
- /usr/sbin/bcfg2-server -D "${PIDFILE}"
- fi
- echo "bcfg2-server"
+ log_begin_msg "Starting Configuration Management Server"
+ log_progress_msg "bcfg2-server"
+ start_daemon ${DAEMON} ${PARAMS}
+ log_end_msg $?
;;
stop)
- echo -n "Stopping bcfg2-server: "
- if [ -f "/etc/debian_version" ] ; then
- /sbin/start-stop-daemon -p "${PIDFILE}" -K /usr/sbin/bcfg2-server
- else
- kill -INT `cat ${PIDFILE}`
- fi
- echo done
+ log_begin_msg "Stopping Configuration Management Server"
+ log_progress_msg "bcfg2-server"
+ killproc -p "${PIDFILE}" ${DAEMON}
+ log_end_msg $?
;;
- restart)
+ force-reload|restart)
$0 stop
sleep 5
$0 start
;;
- force-reload)
- $0 stop
- $0 start
- ;;
*)
- echo "Usage: bcfg2-server {start|stop|restart|force-reload}"
+ log_success_msg "Usage: bcfg2-server {start|stop|restart|force-reload}"
exit 1
esac