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