On 06/05/2016 03:23 AM, J. GarcĂa wrote: > I run systemd , but I have not tested your script, as of now I'm not > using spamassassin, but I will at some time in near future; but looking > at the script, I see some problems, you run the OpenRC restart commands > even if systemd is available, further it doesn't know which one is > running, as both can be installed(And are installed if using systemd),
That's what the "/etc/init.d/spamd status" command is meant to check. The "... status" will only return success if you are running spamd via openrc. Likewise, as I understand it (but haven't tested), the "systemctl try-restart spamassassin" command will only work if you are *using* systemd and the spamassassin service is running. They should be harmless otherwise. For example... # spamd --daemonize # /etc/init.d/spamd status * status: stopped # echo $? 3 If on the first line I had done "systemctl start spamassassin.service", I should get the same result, so the openrc reload commands will be skipped for systemd users. I did take your suggestion and check for rc-service though. I shouldn't count on openrc being in @system forever.

