https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8036

--- Comment #3 from Sidney Markowitz <sid...@sidney.com> ---
Created attachment 5806
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5806&action=edit
proposed patch to set $0 so ps -C spamd works

I at first tried to fix it in the exec call, but ps on linux seems to not use
the program name that is set there for the comm name that is uses in ps -C

Since bug 7594 showed that setting $0 messed up ps -C I tried fixing this by
setting $0 to something that works. perldoc on $0 says that it sets the legacy
ps name which on linux is truncated to 15 characters. That truncation was the
underlying cause of the problem in bug 7594.

This patch reinstates the setting of $0 before daemonizing, just like what was
removed in the fix for bug 7594, but hardcodes it to just 'spamd' instead. Like
it was there, it is not done if debug logging is on and it is only done for
daemonized processes. Note that this will set it to 'spamd' even if the spamd
script file is renamed to something else. I don't think we need to handle it
differently in the case of the script file being renamed.

Please test and vote. I only tested on Linux so far, probably would be a good
idea to check the behavior on a BSD.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to