1 |
On Sat, Jun 4, 2016 at 6:48 PM, Michael Orlitzky <mjo@g.o> wrote: |
2 |
> I'm planning on adding USE=cron to mail-filter/spamassassin to perform |
3 |
> nightly updates. I have a script that works for OpenRC, |
4 |
> |
5 |
> https://wiki.gentoo.org/wiki/SpamAssassin#Daily_updates |
6 |
> |
7 |
> but I've commented where I would like to have something similar for |
8 |
> systemd users. Anybody know how to do that? |
9 |
> |
10 |
> We can't count on systemd being installed, so we need to... |
11 |
> |
12 |
> 1. Test that systemd is installed. |
13 |
> |
14 |
> 2. Check if e.g. spamd is running (depends on #1 for the commands). |
15 |
> |
16 |
> 3. Reload or restart the daemon if #1 and #2 hold; or do nothing if |
17 |
> one of them doesn't. |
18 |
> |
19 |
|
20 |
Couldn't you just check for the existence of systemctl, and if it |
21 |
exists call "systemctl try-restart spamd". That will only work if |
22 |
systemd is running and spamd is running. I'm sure you can accomplish |
23 |
the same via dbus as well. |
24 |
|
25 |
|
26 |
-- |
27 |
Rich |