[systemd-devel] restart vs. stop/start
Lennart Poettering
lennart at poettering.net
Tue May 24 10:05:19 UTC 2016
On Mon, 23.05.16 22:45, Christian Boltz (systemd-devel at cboltz.de) wrote:
> > We don't support that as our logic permits merging of jobs. This means
> > that if two clients enqueue two stop or two start jobs at the same
> > time, then we will only actually run one. In fact, this merging of
> > jobs goes even further: restart and start can be merged. And that
> > means there's really no clear concept of "My service is being stopped
> > for a restart", as your service might actually be stopped on request
> > of 7 clients, where 4 wanted to start it, 1 wanted to stop it, and 2
> > wanted to restart it....
>
> I'm mostly interested in catching manual restarts done by an admin (the
> RPM %post scripts already use reload as they should [1]), so this
> wouldn't be a problem.
systemd does not distuingish how or why services are started, and it
will always exposes the same behaviour regardless of the trigger. And
even though you might disagree, but that's really a good thing.
> > No, not really... Except that you could misuse the fd store logic for
> > this, as you already found out...
>
> So you are saying that I'll need to add a small keep-the-fd-open daemon
> to find out if restart was used?
No, I am saying you should give up on the idea to map your sysv script
to systemd unit 1:1. It doesn't fit.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list