Oneshot services with start/stop commands need RemainAfterExit=yes

Bug #1647169 reported by Simon Fels on 2016-12-04
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Snappy
High
Scott Sweeny

Bug Description

If we specify a service in a snapcraft.yaml like

 service1:
   command: bin/start.sh
   stop: bin/stop.sh
   type: oneshot

and start.sh doesn't leave any process around systemd can track starting the service unit will fail with an error from systemd. To fix this we need to add RemainAfterExit=yes to the created service unit file to tell systemd it should consider the unit as active even if there is not running process it can track. See https://www.freedesktop.org/software/systemd/man/systemd.service.html for details.

Jamie Strandboge (jdstrand) wrote :

I can confirm this and the feature is broken since the systemd failure makes the snap fail to install. Marking as Triaged and setting to High. Jamie or Michael, please adjust as necessary.

Changed in snappy:
importance: Undecided → High
status: New → Triaged
Scott Sweeny (ssweeny) on 2017-02-22
Changed in snappy:
status: Triaged → In Progress
assignee: nobody → Scott Sweeny (ssweeny)
Scott Sweeny (ssweeny) wrote :

This is fixed in snapd trunk, will be in a release soon.

Changed in snappy:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers