add support for services that fork themselves

Bug #1490574 reported by Ricardo Kirkner
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Critical
Unassigned
15.04
Fix Released
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 (mvo)
Changed in snappy:
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

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').

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1490574] Re: add support for raw systemd unit files

+1 to Jamie's line of argument; generating the systemd units ensures we
can guarantee security, or fix a problem ourselves when needed.

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: add support for raw systemd unit files

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
Revision history for this message
Michael Vogt (mvo) wrote :

This is fixed with the latest stable image.

Changed in snappy:
status: Triaged → 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.