Re:Disabling Snaps in Ubuntu 20.04
by jlgaddis on Saturday April 25, 2020 @02:49PM
(#22980315)
I run Debian on my workstation and laptops but still prefer to use CentOS/RHEL on my servers.
The automatic startup of newly installed services (before you even have the opportunity to configure them) on Debian (and derivatives) has always bothered me and is a (small) factor in my decision.
Fortunately, there are a few "workarounds" to prevent newly installed services from being automatically started!
First, there's the brute-force / heavy-handed approach -- override the systemd presets [0] to set all services to disabled by default:
Alternatively, as a one-time thing, you can "mask" the service before installing the package but this requires you to manually create the symlink (instead of using "systemctl mask") -- and requires you to know the name of the service unit beforehand:
Finally, there's the old, "sloppy" (IMO) method of "hacking" the /usr/sbin/policy-rc.d script to immediately exit with a status code of 101 ("action forbidden") [1].
(I'd recommend avoiding the latter entirely and going with whichever of the first two options better suits your needs.)
---
EDIT: Just remembered another method but I'm not sure if it still works:
The automatic startup of newly installed services (before you even have the opportunity to configure them) on Debian (and derivatives) has always bothered me and is a (small) factor in my decision.
Fortunately, there are a few "workarounds" to prevent newly installed services from being automatically started!
First, there's the brute-force / heavy-handed approach -- override the systemd presets [0] to set all services to disabled by default:
Alternatively, as a one-time thing, you can "mask" the service before installing the package but this requires you to manually create the symlink (instead of using "systemctl mask") -- and requires you to know the name of the service unit beforehand: Finally, there's the old, "sloppy" (IMO) method of "hacking" the /usr/sbin/policy-rc.d script to immediately exit with a status code of 101 ("action forbidden") [1].(I'd recommend avoiding the latter entirely and going with whichever of the first two options better suits your needs.)
---
EDIT: Just remembered another method but I'm not sure if it still works:
---[0]: https://www.freedesktop.org/software/systemd/man/systemd.pre...
[1]: https://people.debian.org/~hmh/invokerc.d-policyrc.d-specifi...