add support for services that fork themselves
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Snappy |
Critical
|
Unassigned | ||
| | 15.04 |
Undecided
|
Unassigned | ||
Bug Description
While writing a snappy package, I found an issue where systemd would not start the service defined in my snap package properly.
Upon closer inspection of the issue (thanks mvo!) we found that the problem was that the application itself was already forking to become a daamon, which requires the unit file to indicate this by adding Type=forking to the Service description.
After adding that stanza manually, the service started properly via systemd.
Please add support to snappy to specify that the service handles forking itself, thus causing the systemd unit file to have a Type=forking in the Service section.
Related branches
- Michael Vogt: Approve on 2015-09-15
- John Lenton: Approve on 2015-09-04
-
Diff: 104 lines (+34/-7)5 files modifieddocs/meta.md (+3/-1)
snappy/click.go (+1/-0)
snappy/click_test.go (+25/-4)
snappy/snapp.go (+1/-0)
systemd/systemd.go (+4/-2)
| Changed in snappy: | |
| status: | New → Triaged |
| importance: | Undecided → Critical |
| Jamie Strandboge (jdstrand) wrote : | #1 |
+1 to Jamie's line of argument; generating the systemd units ensures we
can guarantee security, or fix a problem ourselves when needed.
Can we change the title and summary to reflect the fact that we want to support forking processes in our services.
I also prefer not leaking systemd concepts into snappy (it should be an implementation detail).
| summary: |
- add support for raw systemd unit files + add support for services that fork themselves |
| description: | updated |
| Michael Vogt (mvo) wrote : | #4 |
This is fixed with the latest stable image.
| Changed in snappy: | |
| status: | Triaged → Fix Released |


Please do not allow shipping a custom systemd unit file. The unit file specification is extremely rich and this would create a number of problems for reviews, possibly unintended interactions with the system and potential security problems. We should continue along the path of autogenerating this files from the app yaml (ie, in this case, add something to the yaml that will give you 'Type=forking').