snappy services - auto restart

Martin Pitt martin.pitt at ubuntu.com
Wed May 20 07:13:14 UTC 2015


Alexander Sack [2015-05-19 12:40 +0200]:
> > In a systemd unit this is the "Restart=" option, see man
> > systemd.service(5). In paticular, Restart=on-failure is the most
> > popular option.
> >
> > However, TTBOMK this option isn't exposed in the snap's YAML, so this
> > needs to be added there.
> 
> Shouldn't this be the default in almost all cases?

For snaps? Starting with adding Restart=on-failure to the synthesized
.services for snaps sounds like a good first approach which avoids
adding/exposing more metadata.

Auto-restarting on failure does not make much sense for socket/D-BUS
activated services, i. e. if something is Type=dbus or ships a .socket
unit. But neither is currently the case for snaps, right?

> What other options exists for Restart= that might make sense?

Without knowing more details about the unit, on-failure is the best
universal default. The other modes (see man systemd.service) might
make sense for some situations, but these really require a
case-by-case consideration.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)



More information about the snappy-app-devel mailing list