1

I believe it is a default behavior of snap install command to start daemons when a snap package is installed for the first time and made available to a system.

In my particular case I would rather not have it run automatically and let the user decide when they want to start the daemon.

So, is there a way to control whether daemon is run on snap install?

  • Could you just make it an app instead of a service? – Kyle Jul 2 '16 at 16:46
  • Then a service file wouldn't be generated. I still want to treat it as a proper service I just would like not to start services on install of a snap package. – ILIV Jul 4 '16 at 9:11
  • 2
    The mechanism that you are looking to integrate with snap is systemd presets. – JdeBP Jul 5 '16 at 9:08
2

Not that I know of. You can do that manually with the systemctl enable or disable commands with the generated .service file in /etc/systemd/system/. You can as well have a wrapper script which is checking for a file in $SNAP_DATA and block until this one has some desired value, blocking thus the service to start until configured for example.

Another way to look at it (if your snap only ship this service), is why would people install a snap to have it not running?

| improve this answer | |
  • Ah, wrapper scripts and creating crutches to do basic things. snap packages are so unnecessarily complicated, inflexible and limiting. I appreciate your answers didrocks, but I'm so frustrated at what I learned about snap packages. It has proven to be the most unintuitive packaging system I've ever worked with on Linux. – ILIV Jul 4 '16 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.