Red Hat Bugzilla – Bug 656911
provide native spamd.service systemd file
Last modified: 2012-01-20 15:37:14 EST
Created attachment 462638 [details]
spamassassin.service native systemd file
The attached file is a native systemd file for upcoming F15 Feature 
Please read  on how to installing systemd Service files.
If you have any question don't hesitate to ask them on this bug report.
1) for optimal performance, please remove “-d” from SPAMDOPTIONS in /etc/sysconfig/spamassassin
2) portreserve call should be removed, instead spamd should be ported to be socket-activated
3) it would be nice to convert sa-update cron-job to .timer type unit (man systemd.timer).
1) How does removing -d improve performance?
2) What distributions support socket-activated? Since what version of Fedora/RHEL?
3) Sure, but it should be done as a boolean so it uses cron in older distros, systemd in F15+.
Perhaps change this to:
Yes, change in descriptionis preferable. As for other questions:
1) -d gives two things: first, on fork() is eliminated from daemon startup; second, systemd do not have to guess which process is main spamd process. So it can effectively difference between main process and child processes, and restart service only when main process dies for some reason.
(systemd is quite good at guessing but not having to guess is better)
Alternatively, "-d" can be moved from sysconfig file into init.d script (and left out of systemd unit definition).
2) This is tied to systemd, so F14 (technical preview).
As far as I know there are only few daemons implementing sock-act right know: dbus, avahi, beanstalkd, rsyslog.
Created attachment 513251 [details]
Native systemd service file that actually works
Created attachment 513252 [details]
Spec file patch
If you dont have time to package this make note of that on this report and I see if I cant find a proven packager to do it for you.
Thank you for your input. The spec patch must be reworked to use %if booleans to support sysv or systemd depending on which distro it is built upon. nb said he would work on this conversion earlier.
And no, we will not put the sysv stuff into an optional subpackage.
If you want, for a single Fedora release, to provide both a sysv initscript and a systemd unit file, the sysv stuff must be in a subpackage some maintainers do for whatever weird reason but the majority drops the legacy sysv initscrip once they ship a native systemd unit file and as you can clearly see in the spec file I remove the legacy sysv init script anyway just use the patch as a template for whatever you end up doing..
Subpackage will not happen. It is clear how this should be done to be either sysv or systemd. nb said he would do this. If he doesn't, then please inform me and I will.
spamassassin-3.3.2-4.fc16 has been submitted as an update for Fedora 16.
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing spamassassin-3.3.2-4.fc16'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
This update fails to meet the packaging guidelines the legacy sysv init script should be dropped or packaged separably.
spamassassin will not split into multiple sub-packages.
This .src.rpm is designed to output sysv *or* systemd depending on the target OS it is built upon. This is meant as the easiest way to maintain spamassassin across RHEL5, RHEL6 and the latest Fedora releases simultaneously.
The packaging guidelines should be ignored if they demand complete removal of sysv from the .src.rpm. The .src.rpm containing sysv has nothing to do with the F16+ binary rpm that lacks sysv scripts.
(In reply to comment #14)
> spamassassin will not split into multiple sub-packages.
> This .src.rpm is designed to output sysv *or* systemd depending on the target
> OS it is built upon. This is meant as the easiest way to maintain spamassassin
> across RHEL5, RHEL6 and the latest Fedora releases simultaneously.
Understood I was aware that some were doing that.
What got me confused was the presence of the legacy sysv init script in the package http://koji.fedoraproject.org/koji/rpminfo?rpmID=2656173
I cant recall packages for those going down the same or similar path as you actually containing the legacy sysv init script after the rpm has been built
I will test install this on an F16 to see if that is actually is the case ( as in the legacy sysv script getting installed )
> The packaging guidelines should be ignored if they demand complete removal of
> sysv from the .src.rpm. The .src.rpm containing sysv has nothing to do with
> the F16+ binary rpm that lacks sysv scripts.
Afaik the guidelines only say that you should not install both so that's what I look for.
Personally I fail to understand/see the purpose of why some choose to ship the legacy sysv init script in a subpackage since you cant fall back to using upstart et all and the path you have chosen is the only logical way if you are maintaining packages and need to support both the legacy init script and the native systemd simultaneously for RHEL and Fedora.
Also now that you ship native systemd units you should be able to drop the requirements for portreserve see bug 617331 for details ( + Tim was planning on deprecating it )
If the binary rpm contains both, that is indeed incorrect, and it should be fixed.
spamassassin-3.3.2-6.fc15 has been submitted as an update for Fedora 15.
spamassassin-3.3.2-6.fc14 has been submitted as an update for Fedora 14.
spamassassin-3.3.2-6.fc16 has been submitted as an update for Fedora 16.
This has broken spamassasin start process. I cannot start spamassasin via
systemd. I get the following in /var/log/messages:
Sep 12 08:01:23 compsci systemd: spamassassin.service: main process exited, code=exited, status=64
Sep 12 08:01:24 compsci systemd: spamassassin.service holdoff time over, scheduling restart.
Sep 12 08:01:24 compsci systemd: Unit spamassassin.service entered failed state.
Sep 12 08:01:24 compsci systemd: Cannot add dependency job for unit mdmonitor-takeover.service, ignoring: Unit mdmonitor-takeover.service failed to load: No such file or directory. See system logs and 'systemctl status mdmonitor-takeover.service' for details.
Very serious since the mailboxes filled with spam since the yum upgrade to -6.
What version? Fedora 14, 15, or 16? 14 and 15 should not be affected.
It is Fedora 15. -6 versiiom is giving the above error.
Version -4 works fine.
OK, I figured out what was going on. Apparently I made a typo in my spec file and told it to use the systemd unit file for >= 15 instead of >= 16, and the first systemd unit file that was provided to me actually didn't work, I'm building -7 now, which uses sysvinit for 15, per policy, and has a working unit file for 16 and rawhide.
spamassassin-3.3.2-7.fc14 has been submitted as an update for Fedora 14.
spamassassin-3.3.2-7.fc15 has been submitted as an update for Fedora 15.
spamassassin-3.3.2-7.fc16 has been submitted as an update for Fedora 16.
spamassassin-3.3.2-7.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
spamassassin-3.3.2-7.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
spamassassin-3.3.2-7.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
As of today, running F16, I can find *no* spam anything systemd service to start/stop. I have installed the following:
but have no way to start spamd. Please fix!
my apologies. systemctl list-units didn't display the service as being available. however, systemctl enable spamassassin.service enables it.