The rc script for sabnzbd fails to stop the process. See, I added a newsgroups host, which was added to sabnzbd.ini The stop command in the rc.d script uses grep to find what host to send the stop command to (it uses the web interface to shutdown sabnzbd): host=`grep -E '^host\ =\ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9].'` The problem is, now that I added a newsgroups host, grep matches it too. Which gives me a $host variable with: "127.0.0.1" (interface sabnzbd binds to) AND again "yourdummyngprovider.com" (the newsgroups host) for a grand total of: $host="127.0.0.1yourdummyngprovider.com" In turn, the stop command then tries to curl to: http://127.0.0.1yourdummyngprovider.com:8080/api?mode=shutdown&apikey=yourapikeyhere This will never work. Fix: I suggest changing the grep command from: host=`grep -E '^host\ =\ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9].'` to host=`grep -E -m1 '^host\ =\ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9].'` -m1 ensures grep stops after 1 match, which is what we want. Notice this is already done to determine what port the sabnzbd daemon is listening on: port=`grep -m1 ^port ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9]'` I have made this change to the rc script on my box and it works fine. How-To-Repeat: This problem is repeatable all the time.
Additional information: I forgot to say, the newsgroup host I added points to a local stunnel which in turn forwards requests to my actual newsgroups provider. Thus the host I added for newsgroups is 127.0.0.1:119 , and that is why the rc script's grep matches it, in addition to the host sabnzbd runs on.
Patch attached, to be run against the rc script patch /usr/local/etc/rc.d/sabnzbd sabnzbd.patch
Daniel, please check <http://www.freebsd.org/cgi/query-pr.cgi?pr=153357> and follow up with a message stating whether you approve of the proposed patch. Thank you. Best regards Matthias Andree
State Changed From-To: open->feedback waiting for maintainer feedback (approval/disapproval)
Responsible Changed From-To: freebsd-ports-bugs->mandree I'll take it.
mandree 2011-02-24 20:18:30 UTC FreeBSD ports repository Modified files: news/sabnzbdplus Makefile news/sabnzbdplus/files sabnzbd.in Log: Only grep first host from .ini file in rcfile when shutting down. Submitted by: Damien Fleuriot <dam@c-mal.com> Approved by: Daniel Bretoi <daniel@netwalk.org> (maintainer) PR: ports/153357 Revision Changes Path 1.31 +1 -0 ports/news/sabnzbdplus/Makefile 1.2 +1 -1 ports/news/sabnzbdplus/files/sabnzbd.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: feedback->closed Committed. Thanks!
-------- Original-Nachricht -------- Betreff: Re: ports/153357: [patch] news/sabnzbdplus: rc script fails to kill the process Datum: Thu, 24 Feb 2011 08:02:01 -0800 Von: Daniel <daniel@netwalk.org> An: Matthias Andree <mandree@freebsd.org> I approve On Thu, Feb 24, 2011 at 4:05 AM, Matthias Andree <mandree@freebsd.org <mailto:mandree@freebsd.org>> wrote: Daniel, please check <http://www.freebsd.org/cgi/query-pr.cgi?pr=153357> and follow up with a message stating whether you approve of the proposed patch. [...]