Oneshot services with start/stop commands need RemainAfterExit=yes
Bug #1647169 reported by
Simon Fels
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:/
Changed in snappy: | |
status: | Triaged → In Progress |
assignee: | nobody → Scott Sweeny (ssweeny) |
Changed in snappy: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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.