public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Michael Orlitzky <mjo@gentoo.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Safe systemd "reload" command
Date: Mon, 6 Jun 2016 18:59:39 -0400	[thread overview]
Message-ID: <5756005B.1090302@gentoo.org> (raw)
In-Reply-To: <CAOdo=SywNHXEgkO5T8Rf8qiL5EOWWqWupHV3HK+O_tVwp2bXJA@mail.gmail.com>

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...



  reply	other threads:[~2016-06-06 22:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-04 22:48 [gentoo-user] Safe systemd "reload" command Michael Orlitzky
2016-06-05  0:19 ` Rich Freeman
2016-06-05  0:47   ` Michael Orlitzky
2016-06-05  1:01     ` Michael Orlitzky
2016-06-05  7:23       ` J. García
2016-06-05 13:37         ` Michael Orlitzky
2016-06-05 14:31           ` Rich Freeman
2016-06-05 15:37           ` J. García
2016-06-05 15:44             ` J. García
2016-06-05 16:09             ` Michael Orlitzky
2016-06-05 16:27               ` J. García
2016-06-05 16:54                 ` Michael Orlitzky
2016-06-07  9:23                 ` Tom H
2016-06-06 22:17         ` Tom H
2016-06-06 22:04 ` Tom H
2016-06-06 22:59   ` Michael Orlitzky [this message]
2016-06-07 10:17     ` Tom H
2016-06-07 13:13       ` Michael Orlitzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5756005B.1090302@gentoo.org \
    --to=mjo@gentoo.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox