Your message dated Mon, 22 Aug 2011 16:31:54 +0200
with message-id <4e52685a.6020...@debian.org>
and subject line closed by 2.33-1
has caused the Debian Bug report #622225,
regarding Improved init.d/transmission-daemon script
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
622225: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=622225
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: transmission-daemon
Version: 2.03-2
Tags: patch
I've improved (IMO) init.d/transmission-daemon script
the changes are:
* PIDFILE
* IOSCHED
* NICE
* increased STOP_TIMEOUT
PIDFILE didn't work because the daemon is started as another user, so
unable to write to the file. --make-pidfile doesn't change ownership
either (may be submit a feature request?). So I create it and chown.
STOP_TIMEOUT is too small, daemon is killed so unable to save anything.
Increased.
Please, integrate it to the new package build.
Leo 'costela' Antunes wrote:
Hi,
First off, problems and suggestions with Debian packages are better
discussed via a bugreport. Direct emails have a high chance of getting lost.
On 10/04/11 08:47, Roman Rybalko (devel) wrote:
PIDFILE didn't work because the daemon is started as another user, so
unable to write to the file. --make-pidfile doesn't change ownership
either (may be submit a feature request?). So I create it and chown.
Did you have any problems with --exec ? In this case I actually don't
see a problem in using it. I initially wanted to use --pidfile simply
out of habit, but in hindsight --exec doesn't seem to have caused any
problem in all these years.
Regardless, thanks for the heads-up regarding the "--pid-file" option
anyway. It's not even in the manpage.
--exec doesn't allow to launch another instances
STOP_TIMEOUT is too small, daemon is killed so unable to save anything.
Increased.
Good idea.
As for iosched, I don't see the point. Best-effort is the default
scheduler anyway, so it's not really much of a change.
And changing the nice value also seems a bit overkill. Have you really
seen performance issues while running it?
I'm open to adding it as an option in /etc/default/transmission-daemon,
but it honestly seems unnecessary in all but the most bizarre of cases.
Yes, I have performance issues, my samba stucks when transmission is
actively downloads/uploads something. So I need to decrease
transmission's nice & iosched priority.
As you can see, I decreased by default iosched to best-effort:7 (default
is best-effort:4) and nice to 5 (default is 0).
Actually I need to be able to set these values through
/etc/default/transmission-daemon.
--
WBR,
Roman Rybalko
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: transmission-daemon
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the transmission-daemon.
### END INIT INFO
NAME=transmission-daemon
DAEMON=/usr/bin/$NAME
USER=debian-transmission
PIDFILE=/var/run/$NAME.pid
STOP_TIMEOUT=30
CHDIR=/tmp
IOSCHED=best-effort:7
NICE=5
export PATH="${PATH:+$PATH:}/sbin"
[ -x $DAEMON ] || exit 0
[ -e /etc/default/$NAME ] && . /etc/default/$NAME
. /lib/lsb/init-functions
start_daemon () {
if [ $ENABLE_DAEMON != 1 ]; then
log_progress_msg "(disabled, see /etc/default/${NAME})"
else
touch $PIDFILE
chown $USER $PIDFILE
start-stop-daemon --start \
--chuid $USER --chdir $CHDIR \
--iosched $IOSCHED --nicelevel $NICE \
--startas $DAEMON --pidfile $PIDFILE -- --pid-file $PIDFILE $OPTIONS
fi
}
case "$1" in
start)
log_daemon_msg "Starting bittorrent daemon" "$NAME"
start_daemon
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--pidfile $PIDFILE --retry $STOP_TIMEOUT \
--oknodo
log_end_msg 0
;;
reload)
log_daemon_msg "Reloading bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--pidfile $PIDFILE \
--oknodo --signal 1
log_end_msg 0
;;
restart|force-reload)
log_daemon_msg "Restarting bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--pidfile $PIDFILE --retry $STOP_TIMEOUT \
--oknodo
start_daemon
log_end_msg 0
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}"
exit 2
;;
esac
exit 0
--- transmission-daemon.orig 2011-04-11 11:20:18.000000000 +0400
+++ transmission-daemon 2011-04-11 11:20:18.000000000 +0400
@@ -11,9 +11,11 @@
NAME=transmission-daemon
DAEMON=/usr/bin/$NAME
USER=debian-transmission
-# FIXME: no pidfile support; forks, so --make-pidfile doesn't work either
-#PIDFILE=/var/run/$NAME.pid
-STOP_TIMEOUT=3
+PIDFILE=/var/run/$NAME.pid
+STOP_TIMEOUT=30
+CHDIR=/tmp
+IOSCHED=best-effort:7
+NICE=5
export PATH="${PATH:+$PATH:}/sbin"
@@ -26,10 +28,13 @@
start_daemon () {
if [ $ENABLE_DAEMON != 1 ]; then
log_progress_msg "(disabled, see /etc/default/${NAME})"
- else
+ else
+ touch $PIDFILE
+ chown $USER $PIDFILE
start-stop-daemon --start \
- --chuid $USER \
- --exec $DAEMON -- $OPTIONS
+ --chuid $USER --chdir $CHDIR \
+ --iosched $IOSCHED --nicelevel $NICE \
+ --startas $DAEMON --pidfile $PIDFILE -- --pid-file $PIDFILE $OPTIONS
fi
}
@@ -42,21 +47,21 @@
stop)
log_daemon_msg "Stopping bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
- --exec $DAEMON --retry $STOP_TIMEOUT \
+ --pidfile $PIDFILE --retry $STOP_TIMEOUT \
--oknodo
log_end_msg 0
;;
reload)
log_daemon_msg "Reloading bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
- --exec $DAEMON \
+ --pidfile $PIDFILE \
--oknodo --signal 1
log_end_msg 0
;;
restart|force-reload)
log_daemon_msg "Restarting bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
- --exec $DAEMON --retry $STOP_TIMEOUT \
+ --pidfile $PIDFILE --retry $STOP_TIMEOUT \
--oknodo
start_daemon
log_end_msg 0
--- End Message ---
--- Begin Message ---
This bug got closed by the 2.33-1 upload.
It unfortunately ended up being uploaded it with the incomplete
changelog. The right changelog for it can be seen here:
http://anonscm.debian.org/gitweb/?p=collab-maint/transmission.git;a=blob;f=debian/changelog;h=36ee2706d3381be94b75c250f6c2227d3d471350;hb=07098879d9fcb7c0cc88cf3f29f617530ed20ae8
Cheers
--
Leo "costela" Antunes
[insert a witty retort here]
--- End Message ---