systemd: Tagging /dev/virtio-ports/* for systemd

"Jóhann B. Guðmundsson" johannbg at gmail.com
Wed Jul 6 11:37:16 UTC 2011


On 07/06/2011 11:21 AM, Richard W.M. Jones wrote:
> On Tue, Jul 05, 2011 at 08:36:42PM +0200, Lennart Poettering wrote:
>> On Tue, 05.07.11 16:54, Daniel P. Berrange (berrange at redhat.com) wrote:
>>> [Service]
>>> ExecStart=-/usr/sbin/guestfsd
>> Prefixing the binary path with "-" will result in the exit code of
>> guestfsd be ignored, i.e. we wouldn't put the service into failed state
>> if it crashes (or exits otherwise abnormally). I'd encourage never to
>> prefix with "-" unless you have a really good reason to.
> In this case, I think we do.  The daemon only handles one connection
> at a time (that is the nature of virtio-serial ports) and it will exit
> with EXIT_FAILURE if an error is read in the protocol.  This can
> happen in some legitimate-ish cases, eg. if the host side disconnects
> without "properly" closing the connection.
>
> But what we'd want to avoid is the case where the daemon dies during
> startup, and we get into a loop repeatedly relaunching the daemon.
>
> The question is, does systemd implement respawn throttling like inetd?

Hum

Would Restart= not suffice as in..

Restart=on-failure

Or

Restart=on-abort

from man systemd.service

Restart=
            Configures whether the main service process shall be 
restarted when it exits. Takes one of no, on-success, on-failure,
            on-abort or always. If set to no (the default) the service 
will not be restarted when it exits. If set to on-success it will
            be restarted only when it exited cleanly, i.e. terminated 
with an exit code of 0. If set to on-failure it will be restarted
            only when it exited with an exit code not equalling 0, or 
when terminated by a signal. If set to on-abort it will be
            restarted only if it exits due to reception of an uncaught 
signal. If set to always the service will be restarted regardless
            whether it exited cleanly or not, or got terminated 
abnormally by a signal

JBG


More information about the devel mailing list