packaging: script init.d pour rpm

This commit is contained in:
Thomas NOËL 2012-07-25 12:41:42 +02:00
parent d23e6d43e2
commit 9983eddc7e
1 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# polynum polycopies numeriques
# polynum Polycopies Numeriques
#
# chkconfig: 2345 20 80
# description: PolyNum web application
@ -24,6 +24,10 @@ exec="/opt/polynum/bin/polynum-manage.py"
prog="polynum"
config="/etc/polynum/local_settings.py"
# polynum config
POLYNUM_USER=polynum
POLYNUM_GROUP=polynum
PIDFILE=/var/run/polynum/polynum.pid
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
@ -32,7 +36,8 @@ start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
# if not running, start it up here, usually something like "daemon $exec"
[ x$START_DAEMON != xyes ] && echo " disable by /etc/sysconfig/$prog" && exit 3
daemon --user $POLYNUM_USER --pidfile $PIDFILE $exec $DAEMON_ARGS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
@ -41,7 +46,7 @@ start() {
stop() {
echo -n $"Stopping $prog: "
# stop it here, often "killproc $prog"
killproc -p $PIDFILE $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
@ -63,7 +68,7 @@ force_reload() {
rh_status() {
# run checks to determine if the service is running or use generic status
status $prog
status -p $PIDFILE $prog
}
rh_status_q() {