le start du script d'init est actif uniquement si START_DAEMON=yes

This commit is contained in:
Thomas NOËL 2012-07-20 11:25:54 +02:00
parent 6a1c84ef34
commit b320cff367
2 changed files with 21 additions and 9 deletions

8
debian/init.d vendored
View File

@ -22,6 +22,7 @@ SCRIPTNAME=/etc/init.d/$NAME
POLYNUM_USER=polynum
POLYNUM_GROUP=polynum
START_DAEMON=no
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
@ -87,9 +88,14 @@ do_stop()
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
if [ "$START_DAEMON" != yes ]
then
log_progress_msg "(disable by /etc/default/polynum)" && log_end_msg 1
exit 0
fi
do_start
case "$?" in
0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
1) [ "$VERBOSE" != no ] && log_progress_msg "(was already running)" && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
3)

View File

@ -1,12 +1,8 @@
# Defaults for polynum initscript
# sourced by /etc/init.d/polynum
POLYNUM_USER=polynum
POLYNUM_GROUP=polynum
POLYNUM_HOME=/opt/polynum
POLYNUM_VAR=/var/lib/polynum
POLYNUM_ETC=/etc/polynum
# set to "yes" and init.d script really start polynum...
START_DAEMON=no
PIDFILE=/var/run/polynum/polynum.pid
@ -25,6 +21,16 @@ PIDFILE=/var/run/polynum/polynum.pid
DAEMON_ARGS="run_gunicorn --workers=5 --bind=127.0.0.1:3000 --pid=${PIDFILE} --daemon"
# disable autostart with :
# POLYNUM_RUN=""
#
# polynum system configuration
# Do not touch anything unless you know what you are doing
#
POLYNUM_USER=polynum
POLYNUM_GROUP=polynum
POLYNUM_HOME=/opt/polynum
POLYNUM_VAR=/var/lib/polynum
POLYNUM_ETC=/etc/polynum