Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Safe systemd "reload" command
Date: Sun, 05 Jun 2016 00:19:30
Message-Id: CAGfcS_=-_net-Co=O=UMWXG+MoOjVZaYmg3oNa6xgHQCjTvSrg@mail.gmail.com
In Reply to: [gentoo-user] Safe systemd "reload" command by Michael Orlitzky
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

Replies

Subject Author
Re: [gentoo-user] Safe systemd "reload" command Michael Orlitzky <mjo@g.o>