Bug Tracker item #2947397, was opened at 2010-02-07 15:39 Message generated for change (Comment added) made by sbajic You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2947397&group_id=250683
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: daemon Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Julien Valroff (valroff) Assigned to: Stevan Bajic (sbajic) Summary: dspam exits with 0 when not able to bind to configured port Initial Comment: Hi, When starting dspam in daemon mode as an unprivileged user with the default port 24, dspam cannot bind to the port, and fails to start, which is normal. However, the return code is 0, making it not possible to detect dspam hasn't started. Here is an example (here, dspam is a non privileged user). ds...@sid:/# su dspam ds...@sid:/$ dspam --daemon ds...@sid:/$ echo $? 0 ds...@sid:/$ exit sid:/# ps aux | grep [d]spam sid:/# tail /var/log/syslog Feb 7 16:34:58 sid dspam[1817]: Daemon process starting Feb 7 16:34:58 sid dspam[1817]: Could not bind to :24: Permission denied Feb 7 16:34:58 sid dspam[1817]: Daemon mode failed to start Feb 7 16:34:58 sid dspam[1817]: Daemon process exiting Cheers, Julien ---------------------------------------------------------------------- >Comment By: Stevan Bajic (sbajic) Date: 2010-02-19 18:37 Message: Hallo Julien, thanks for confirming that it works. Regarding the fork issue: Could you please open a feature request so that we can handle that issue separately? As soon as you open that feature request I am going to add in 5 minutes the code to fork DSPAM into background. :) -- Kind Regards from Switzerland, Stevan Bajić ---------------------------------------------------------------------- Comment By: Julien Valroff (valroff) Date: 2010-02-19 16:34 Message: Hi Steve, I confirm it works fine. Thanks for your work! I would like to integrate the "fork dspam into background" as well (we use it in Debian). Would the following be correct: --- a/src/dspam.c +++ b/src/dspam.c @@ -3964,6 +3964,11 @@ DRIVER_CTX DTX; char *pidfile; + /* Fork dspam into the background */ + if (fork()) { + exit(exitcode); + } + __daemon_run = 1; __num_threads = 0; __hup = 0; Cheers, Julien ---------------------------------------------------------------------- Comment By: Stevan Bajic (sbajic) Date: 2010-02-19 12:29 Message: Hallo Julien, can you test if the included patch solves your issue? -- Kind Regards from Switzerland, Stevan Bajić ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2947397&group_id=250683 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Dspam-devel mailing list Dspam-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspam-devel