Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#19206 - [deluge] 1.2.3-3 init script not stopping daemon

Attached to Project: Arch Linux
Opened by Fuzzy (fuzzy) - Thursday, 22 April 2010, 02:18 GMT
Last edited by Ionut Biru (wonder) - Thursday, 22 April 2010, 10:03 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ionut Biru (wonder)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: Changes in deluge 1.2.3-3 init script in /etc/rc.d/deluged (and possibly deluge-web) have made it impossible to kill the daemon in some situations. The scipt searches for deluged pid by doing "pgrep deluged" and writing the result in a pidfile. That however finds both the deluged daemon pid (/usr/bin/deluged) and the pid of the init script itself (/etc/rc.d/deluged). When trying to stop the daemon sript reads in the pid file and validates if a process with this pid exists by doing "[[ -d /proc/$PID ]] || PID=" which zeros out the PID variable if pidfile contains more than one number (as there's no such directory under /proc).


Additional info:
* package deluge 1.2.3-3


Steps to reproduce:
$ sudo /etc/rc.d/deluged start
:: Starting Deluge Daemon [DONE]
[fuzzy@kn-arch rc.d]$ sudo /etc/rc.d/deluged stop
:: Stopping Deluge Daemon [FAI
This task depends upon

Closed by  Ionut Biru (wonder)
Thursday, 22 April 2010, 10:03 GMT
Reason for closing:  Fixed
Comment by Fuzzy (fuzzy) - Thursday, 22 April 2010, 02:26 GMT
(sorry pressed send to soon :))
Steps to reproduce:
$ sudo /etc/rc.d/deluged start
:: Starting Deluge Daemon [DONE]
$ sudo /etc/rc.d/deluged stop
:: Stopping Deluge Daemon [FAIL]
$ cat /var/run/deluged.pid
5304 6149 6159

Possible fixes:
restrict what pgrep finds by adding user and full path conditions: pgrep -u $DELUGE_USER -f "/usr/bin/deluged$"

Loading...