Install daemon in stopped state

Bug #1821788 reported by Evan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Wishlist
Unassigned

Bug Description

If you use an interface in your snap that is not auto-connected, for example system-files, and you have a daemon that relies on that interface being connected (in this case because it reads /sys/class/dmi/id/product_serial), the snap will fail to install and remove itself.

You could get most of the way there by using interface hooks and `snap set some-service command=start`, but you wouldn't have any way to install the snap with the daemon in a stopped state.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This area is under development / cleanup / design extensions by Ian from the snapd team. I will relay this bug to my colleague.

Changed in snapd:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Ian Johnson (anonymouse67) wrote :

This is not a bug exactly because what happens is that the service fails to start, and thus the install is aborted.

The solution here is to use the install hook to disable the service as the install hook runs before the services are started, and we no longer start services which have been disabled from the install hook. Then in the post-connect hook you can restart the service.

We may eventually enable a way for a service to be declared as initially disabled in the snapcraft.yaml, but this is not on our current roadmap.

Changed in snapd:
status: Triaged → Invalid
status: Invalid → Confirmed
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.