Oneshot services with start/stop commands need RemainAfterExit=yes

Bug #1647169 reported by Simon Fels
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
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.

Revision history for this message
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)
Changed in snappy:
status: Triaged → In Progress
assignee: nobody → Scott Sweeny (ssweeny)
Revision history for this message
Scott Sweeny (ssweeny) wrote :

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.