[enh] Allow to set default options for yunohost-api service

This commit is contained in:
Jérôme Lebleu 2015-11-12 13:48:48 +01:00
parent ce57a406c1
commit 7435ba7cee
2 changed files with 10 additions and 1 deletions

4
debian/yunohost-api.default vendored Normal file
View file

@ -0,0 +1,4 @@
# Override yunohost-api options.
# Example to log debug: DAEMON_OPTS="--debug"
#
#DAEMON_OPTS=""

View file

@ -21,6 +21,11 @@ PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME SCRIPTNAME=/etc/init.d/$NAME
LOGFILE=/var/log/$NAME.log LOGFILE=/var/log/$NAME.log
# Include yunohost-api defaults if available
if [ -r /etc/default/yunohost-api ]; then
. /etc/default/yunohost-api
fi
# Exit if the package is not installed # Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0 [ -x "$DAEMON" ] || exit 0
@ -45,7 +50,7 @@ do_start()
|| return 1 || return 1
start-stop-daemon --start --background --make-pidfile --quiet --no-close \ start-stop-daemon --start --background --make-pidfile --quiet --no-close \
--pidfile $PIDFILE --exec $DAEMON -- \ --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS >>$LOGFILE 2>&1 \ $DAEMON_OPTS >>$LOGFILE 2>&1 \
|| return 2 || return 2
} }