public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "J. García" <jyo.garcia@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Safe systemd "reload" command
Date: Sun, 05 Jun 2016 09:37:28 -0600	[thread overview]
Message-ID: <1465141048.5349.76.camel@gmail.com> (raw)
In-Reply-To: <57542B1D.70103@gentoo.org>

El dom, 05-06-2016 a las 09:37 -0400, Michael Orlitzky escribió:
> 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.
> 
It works, and is harmless as you say, but since I'm not running OpenRC,
it prints a warning to stderr about openrc not running, at least I find
that a bit annoying, that's why I suggested to check which one is
running as PID 1. I don't know if systemctl prints anything in the
other case(OpenRC running, and systemd installed) but you can run it
with -q to be silent:
The following message is print every time /etc/init.d/{spamd,amavisd}
status is run, e.g.:

 # /etc/init.d/spamd status
* You are attempting to run an openrc service on a
* system which openrc did not boot.
* You may be inside a chroot or you may have used
* another initialization system to boot this system.
* In this situation, you will get unpredictable results!
* If you really want to do this, issue the following command:
* touch /run/openrc/softlevel 

IMHO, that is junk not needed in logs that might be generated from your
script, but redirecting  any output from /etc/init.d/$SERVICE status to
/dev/null.


  parent reply	other threads:[~2016-06-05 15:37 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 [this message]
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
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=1465141048.5349.76.camel@gmail.com \
    --to=jyo.garcia@gmail.com \
    --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