Package: deluged
Version: 1.3.7-1
Severity: normal
Dear Maintainer,
I am really pleased to see that the recent versions of this package come with
an init-script. I have been using deluge for several years now, and had
previously hacked together an init-script myself, with the help of ones posted
on the web. However, is there a reason that the new init-script passes the -d
argument to deluged (telling it not to daemonize) and instead uses the
--background option to start-stop-daemon? On my own system, I have called
deluged without the -d option, and start-stop-daemon without the --background
option, and it seems to work fine. Is there a technical reason that I am not
aware of for doing it this way?
>From the man page for start-stop-daemon:
--background: Typically used with programs that don't detach on their own.
This option will force start-stop-daemon to fork before starting the process,
and force it into the background. WARNING: start-stop-daemon can not check the
exit status if the process fails to execute for any reason. This is a last
resort, and is only meant for programs that either make no sense forking on
their own, or where it's not feasible to add the code for them to do this
themselves.
To be clear, the changes I'm suggesting are simply to modify the init script
to remove the "-d" switch from DAEMON_ARGS, and to remove the "--background"
switch from both invocations of start-stop-daemon. I have attached a patch
file that does exactly this, for reference.
-- System Information:
Debian Release: wheezy/jessie
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (x86_64)
Foreign Architectures: amd64
Kernel: Linux 3.12-0.bpo.1-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages deluged depends on:
ii deluge-common 1.3.6-1.1
ii python 2.7.8-1
ii python-libtorrent 0.15.10-1
deluged recommends no packages.
deluged suggests no packages.
-- no debconf information
diff -rupN deluge-1.3.7/debian/deluged.init deluge-1.3.7-new/debian/deluged.init
--- deluge-1.3.7/debian/deluged.init 2014-08-30 14:45:20.000000000 -0700
+++ deluge-1.3.7-new/debian/deluged.init 2014-09-01 16:19:33.000000000 -0700
@@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Deluge BitTorrent Daemon"
NAME="deluged"
DAEMON=/usr/bin/$NAME
-DAEMON_ARGS="-d -c /var/lib/deluged/config -l /var/log/deluged/daemon.log -L info"
+DAEMON_ARGS="-c /var/lib/deluged/config -l /var/log/deluged/daemon.log -L info"
USER=debian-deluged
MASK=0027
PIDFILE=/var/run/$NAME.pid
@@ -52,11 +52,11 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- start-stop-daemon --start --background --quiet --pidfile $PIDFILE --exec $DAEMON \
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
--chuid $USER --umask $MASK --test > /dev/null \
|| return 1
- start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON \
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON \
--chuid $USER --umask $MASK -- $DAEMON_ARGS \
|| return 2
fi