On 06/06/2016 06:04 PM, Tom H wrote: > > 1) I've never used systemd on Gentoo but I assume that you can > co-install openrc and systemd. So you'd want to check whether systemd > is running: > > [ -d /run/systemd/system ] >
I think the way I did this, it will be a no-op if systemd is not running (or if e.g. spamd is not running *under* systemd). I committed the cron job yesterday, so I'll hear about it if it doesn't work. > 2) spamassassin.service is running > 3) reload or restart spamassassin.service > > systemctl try-reload-or-restart spamassassin.service > if sa is running, it'll reload it if sa supports a reload, otherwise > it'll restart it > Ah, that sounds like an improvement. It looks like amavisd.service supports reloading, but spamd.service doesn't. The way we do it in spamd.init is to send a HUP signal to the spamd process (determined from its PID file). Google tells me that ExecReload=/bin/kill -HUP $MAINPID should work...

