Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 483374

Summary: =net-nntp/sabnzbd-0.7.14 - Init script tries to read PID file before it is created.
Product: Gentoo Linux Reporter: eponymous <the.epon>
Component: Current packagesAssignee: Justin Bronder (RETIRED) <jsbronder>
Status: RESOLVED FIXED    
Severity: normal CC: the.epon
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=483786
Whiteboard:
Package list:
Runtime testing required: ---

Description eponymous 2013-09-02 11:46:02 UTC
The SabNZBd init script currently tries to read the pid_file (as part of the start routine) before it is created by SabNZBd.

The result is:

# /etc/init.d/sabnzbd start
 * Starting SABnzbd ...
 * start-stop-daemon: fopen `/var/run/sabnzbd/sabnzbd-8090.pid': No such file or directory
 * start-stop-daemon: did not create a valid pid in `/var/run/sabnzbd/sabnzbd-8080.pid'                                                                                                 [ !! ]
 * ERROR: sabnzbd failed to start

although it does actually start the process.

I did try adjusting this so we use the start-stop-daemon to make the pidfile and background the process rather than have SabNZBd do it. However SabNZBd then loses track of the PID and the URL based shutdown doesn't work so this isn't an ideal workaround...


23c23,25
<         --pidfile $(get_pidfile) \
---
>         --make-pidfile \
>         --background \
>         --pidfile ${RUNDIR}/sabnzbd.pid \
28,29c30
<         --daemon \
<         --pid "${RUNDIR}"
---
>         --daemon
79c80
<             [ ! -s $(get_pidfile) ] && break
---
>             [ ! -s ${RUNDIR}/sabnzbd.pid ] && break
83c84
<     if [ -s $(get_pidfile) ]; then
---
>     if [ -s $RUNDIR/sabnzbd.pid ]; then
88c89
<             --pidfile $(get_pidfile) \
---
>             --pidfile ${RUNDIR}/sabnzbd.pid \


FYI:

sys-apps/openrc
      Latest version available: 0.11.8
      Latest version installed: 0.11.8
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-09-02 12:15:48 UTC
Please add a proper unified patch as an attachment instead.
Comment 2 eponymous 2013-09-02 12:28:29 UTC
I (In reply to Tom Wijsman (TomWij) from comment #1)
> Please add a proper unified patch as an attachment instead.

I can happily do this however, the code I added to the digest was a workaround which doesn't actually solve the problem.

I didn't want to make it seem like I'd fixed the issue entirely and was just showing my thought process.
Comment 3 eponymous 2013-09-05 19:15:30 UTC
This bug is fixed by: https://bugs.gentoo.org/show_bug.cgi?id=483786