by jaytaylor · 6y ago · 0 comments
Since 16.04, Snaps have been a huge pain for me with running LXC in production environments.
By default, Snap applies updates and restarts Systemd services anytime it likes, and there's no way to turn this behavior off! The only way to get around it is to download the Snap package binary and install that directly. Then Snap won't "know" where to get updates.
(Caveat emptor: "Workarounds" like this can easily lead to a bad security scenario, since any critical security patches won't be installed by any standard system update process)
Did I mention that a fair percentage of the time the Snap updates would leave LXC in a completely broken state? In production (and development, too)!
The final nail in the coffin in this scenario comes in the form of Snap being the official recommended way to install LXC. I don't know if Stéphane and friends even publish Debian packages anymore.
I get the idea behind snap and appreciate it, but the lack of configurability and no clear definition of what stable really even means . . .
1. prevent machines in the fleet from pulling the broken LXD update
2. rollback broken machines to the previously working LXD version on the same channel, since it no longer existed in the Snap Store™.
What a joke! Now we're burnt on snap _and_ LXD.
Some developers are trying to package for Debian. The work is in progress at https://wiki.debian.org/LXD
The following distributions package LXD (that I know of):
* Void Linux
* Alpine Linux
* Arch Linux
* Gentoo
Some of those are more suitable for production installs than others, but if you know what you are doing and manage your deployments well, all of them could work.
It's clearly not production stuff, but it works very well for a quick test bed before production deployments.
I really have no idea what people are thinking sometimes.
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:
$ cat /etc/systemd/system-preset/00-disable-all-services.preset
disable *
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: $ ln -s /dev/null /etc/systemd/system/nginx.service
$ apt install nginx
# ... configure nginx as desired ...
$ systemctl enable nginx
$ systemctl start nginx
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:
$ RUNLEVEL=1 apt install nginx
---[0]: https://www.freedesktop.org/software/systemd/man/systemd.pre...
[1]: https://people.debian.org/~hmh/invokerc.d-policyrc.d-specifi...
A cultural acceptance of WIP software seems common, in free software communities, in my experience.
On the one hand, yeah it's harder to complain when something is only built in someone's spare time for free. On the other hand... is non-FOSS really any better? Has Windows yet managed to re-merge the old and new control panels?
The first is a fact of life. The second is bad judgement.
Even if people should be updating regularly, forcing them feels completely antithetical to the Linux ethos of users having control over their devices.
Since 2017: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1575053
I feel bad for the maintainers; it must be difficult to deal with all the rude and borderline disrespectful comments -- and particularly for something you're donating your time for free after all. But I must say that the architectural decision of creating a ~/snap was a colossal mistake.
It's not an argument. It's freeness is a completely irrelevant property.
I am on the rolling releases already but I'm not going to install an LTS version that is so deeply integrated with the distributor while at the same time ignores the directory standards so incredible blatantly.
Ubuntu users may be more tech proficient than average users but even for developer machines, I think it takes a lot of concern out of the equation if the software is up-to-date.
As far as I'm concerned this doesn't deserve an '/s'.
With Ubuntu I just wait until the next LTS.
Due to LXC now being a snap, the file is simply not there. I guess it's 5 layers deep in namespaces, overlayfs and other stuff. I was so fed up with this that I removed Ubuntu (and replaced it with Gentoo).
I can't understand why they would break such fundamental thing and seemingly don't care about it.
(Same-but-different for enforcing non-interactive mode on installs.)
The idea with LTS is to be predictable and stable.
Put another way:
- desktop people want ALL UPDATES NOW.
- server people want NOTHING TO CHANGE EVER.
(yes, not exactly that, but kind of)
It is a seriously difficult thing to get right. I always applaud people to take on difficult problems and try to solve them, but I would not expect it to have any sort of robustness for another 5 years at least.
Dear snap developers, don’t make false assumptions that every user in Linux has to have home directory as /home/username just because standard Ubuntu installer does this. Only thing that you should care about here is $HOME
I uninstalled it on all my Ubuntu systems and put it on hold. No new Ubuntu installs, switched to Debian.
I don't know how must be installed on your version, but on 19.10, snap can be completely removed: the only draw back is that pulseaudio depends on it, but I guess that for a server it's not that much of a problem.
For context: https://forum.snapcraft.io/t/disabling-automatic-refresh-for...
Snap developer responses are hilarious. No matter what your use case is, Snap developers know better than you, you silly irresponsible sysadmin/user. Snap is basically just another App store.
I actually really like snaps and that's the only bad experience I've had. I don't know why LXC would come in that form, very weird.