Page 1 of 1

[FEATURE REQUEST] ability to specify pidfile

Posted: December 7th, 2013, 4:50 pm
by feld
Currently it is not possible to specify a pidfile. You can specify a directory with --pid, but the pidfile's name is dynamic, based on the listening port in the format of sabnzbd-port.pid ex, sabnzbd-8080.pid

This is extremely inconvenient for OS init scripts / rc scripts. I've recently revamped the FreeBSD rc script and had to attempt to piece together the pid file with this mess:

pidfile=/var/run/sabnzbd/sabnzbd-$(grep -m1 ^port ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9]').pid

I would really appreciate a more reliable solution, namely the ability to specify the actual pidfile when starting the daemon.


Thanks

Re: [FEATURE REQUEST] ability to specify pidfile

Posted: December 9th, 2013, 3:21 pm
by shypike
I'll have a look at it, but keep in mind that a very very small audience will have this issue.

Re: [FEATURE REQUEST] ability to specify pidfile

Posted: December 10th, 2013, 9:25 am
by jcfp
+1 for the request, despite the admittedly small audience of fools actually writing init scripts ;D

On my favorite os, I'm working around the current pid naming scheme by looking up the correct process 'manually' and feeding the result into a (fixed name) pidfile. I would definitely prefer to specify that pidfile directly on the command line. Anybody who wants to tell pid files apart by ports (or whatever other info) can still easily script that.

Re: [FEATURE REQUEST] ability to specify pidfile

Posted: December 10th, 2013, 1:42 pm
by shypike
I was already looking at an extra parameter (--pidfile).
I prefer not to break compatibility by changing the meaning of the current --pid parameter.

Re: [FEATURE REQUEST] ability to specify pidfile

Posted: December 11th, 2013, 5:54 pm
by jcfp
Just tested what's currently on github, works fine as far as I can tell. Thanks Image