From 7435ba7cee9220770ca281ec44c8d7f98d1dedbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Thu, 12 Nov 2015 13:48:48 +0100 Subject: [PATCH] [enh] Allow to set default options for yunohost-api service --- debian/yunohost-api.default | 4 ++++ debian/yunohost-api.init | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 debian/yunohost-api.default diff --git a/debian/yunohost-api.default b/debian/yunohost-api.default new file mode 100644 index 0000000000..b6a9e5a996 --- /dev/null +++ b/debian/yunohost-api.default @@ -0,0 +1,4 @@ +# Override yunohost-api options. +# Example to log debug: DAEMON_OPTS="--debug" +# +#DAEMON_OPTS="" diff --git a/debian/yunohost-api.init b/debian/yunohost-api.init index bd9f3a0153..02a0560b73 100755 --- a/debian/yunohost-api.init +++ b/debian/yunohost-api.init @@ -21,6 +21,11 @@ PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME 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 [ -x "$DAEMON" ] || exit 0 @@ -45,7 +50,7 @@ do_start() || return 1 start-stop-daemon --start --background --make-pidfile --quiet --no-close \ --pidfile $PIDFILE --exec $DAEMON -- \ - $DAEMON_ARGS >>$LOGFILE 2>&1 \ + $DAEMON_OPTS >>$LOGFILE 2>&1 \ || return 2 }