Services and daemons

Along with socket-mode, a socket keyword also has an attribute of “listen-stream”. https://github.com/snapcore/snapcraft/blob/main/snapcraft/projects.py#L161-L165

I found out something about install-mode today that isn’t documented here. If you have a service (oneshot, simple, etc), and install-mode is disable, then disabling and re-enabling the snap will cause those install-mode disabled services to be disabled again. This is somewhat counter-intuitive to the name “install-mode” because it triggers outside of an install.

So the relevant commands to reproduce this are:

sudo snap install mySnap
snap services mySnap # install-mode disabled services are disabled
sudo snap start --enable mySnap # manually enable services (maybe your snap uses snapctl instead)
snap services mySnap # install-mode disabled services are enabled
snap disable mySnap
snap services mySnap # all services are disabled
snap enable mySnap
snap services mySnap # only non install-mode disabled services are enabled

Hi @degville

Are you aware of any existing docs that cover the installation differences between daemon types ?

I’m asking because, the oneshot type completion blocks snap install and can make install fail, whereas the simple type does not behave like that. Is this topic covered anywhere, and if not could it be incorporate into this doc ?

Cheers, Just

Hello @jocado. Sorry for the long delay responding to you here. I’m not aware of any documentation for this, but I’ve brought this up for a topic of discussion with the team and I’ll report back here and update the doc, as necessary.

1 Like