In the /etc/conf.d/spamd file there is an obsolete comment, this is: # Note: if you plan on using the -u flag to spamd you will need to # make sure the location of the PID file is writable by that user. # This can be done by making the directory /var/run/spamd and # changing the owner to the UID that runs spamd. You will then # need to edit $pidfile in /etc/init.d/spamd. This should fix the # problem with stop/restart in the init scripts. # # See http://bugs.gentoo.org/show_bug.cgi?id=70124 for a full # explanation. I added a new user (spamd) and added the "-u spamd" option to SPAMD_OPTS, without chaging the PIDFILE variable. Now spamd runs, stops/restarts, without any issue. The pidfile, /run/spamd.id, is owned by root, and there are three processes runing: # pstree -u init─┬─/usr/sbin/spamd───2*[spamd child(spamd)] While I have only tested with 3.4.0, I suspect this works since 3.1.0, when spamassassin changed to preforking. See first item in the 3.1.0 announcement http://mail-archives.apache.org/mod_mbox/spamassassin-announce/200509.mbox/%3C20050914235232.814A45900BA@radish.jmason.org%3E This is the syslog output when restarting spamd: # tail -f messages | grep spamd Sep 28 19:02:30 postaria spamd[21979]: spamd: server killed by SIGTERM, shutting down Sep 28 19:02:30 postaria spamd[24549]: logger: removing stderr method Sep 28 19:02:31 postaria spamd[24551]: spamd: server started on IO::Socket::INET6 [127.0.0.1]:783, IO::Socket::INET6 [::1]:783 (running version 3.4.0) Sep 28 19:02:31 postaria spamd[24551]: spamd: server pid: 24551 Sep 28 19:02:31 postaria spamd[24551]: spamd: server successfully spawned child process, pid 24552 Sep 28 19:02:31 postaria spamd[24551]: spamd: server successfully spawned child process, pid 24553 Sep 28 19:02:31 postaria spamd[24551]: prefork: child states: IS Sep 28 19:02:31 postaria spamd[24551]: prefork: child states: II The coment above confused me quite a little bit, I think it is worth removing.
Created attachment 435928 [details, diff] 3.0.0-spamd.conf.patch Master process works with root privilleges but childs use user set by "-u". Indeed, this comment is confusing.
This bug should wait for bug #455604
Done in a new revision: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19ff5b04b9db6b1319b35e9a6da3d26972bf04b5 I removed all mention of the PID file handling and permissions. It should just work out-of-the-box, no matter what you do. The PID is hard-coded to /run/spamd/spamd.pid, but you shouldn't need to mess with it.