11 ms·
Kudos to the OP, I'm glad this got posted on hacker news because Snap is so ridiculously broken. Since 16.04, Snaps have been a huge pain for me with running L
by jaytaylor 6y ago
Kudos to the OP, I'm glad this got posted on hacker news because Snap is so ridiculously broken.
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 . . .
- Wowfunhappy 6y agoUgh, is it still impossible to disable Snap autoupdates? Even if people should be updating regularly, forcing them feels completely antithetical to the Linux ethos of users having control over their devices.
- teraflop 6y agoProps to Microsoft, for getting their approach to Windows updates adopted as an industry standard! /s
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- RMPR 6y agoNext step, introduce the mandatory restart as a standard.
- jschwartzi 6y agoBut wait for the user to have a week-long job running for three days before you do it. That way they have to explain to their boss why there is now a 3 day delay.
- nine_k 6y agoIt's critical? Don't use hobbyist software for that then. Take Debian or CentOS or something else with a non-cavalier development culture.
- hannasanarion 6y agoUbuntu is "hobbyist" now? That's certainly not how they bill their entire platform.
- Brian_K_White 6y agoShe was asking for it by wearing that eh?
- fredsanford 6y agoIf it's good enough for Boeing...
- Barrin92 6y agoI think automatic updates on all platforms are probably an immense net benefit to the world given the huge degree of security vulnerabilities it avoids. 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'.
- enriquto 6y agoThe option to have automatic updates (whether it is enabled by default or not) is an entirely different issue than the obligation to have automatic updates. The first one is a blessing, the second one is a nightmare.
- james_s_tayler 6y agoI remember updating Ubuntu once. It bricked my installation for some reason. Ever since then I rarely update software. With Ubuntu I just wait until the next LTS.
- kevin_thibedeau 6y agoMay as well use Debian and escape the insanity.
- yjftsjthsd-h 6y agoAn important clarification: You never upgrade across major versions in place, or you never `apt-get upgrade`? I understand not jumping versions, but never applying security updates seems... imprudent.
- stefan_ 6y agoThe Snap team has some experience with this, seeing as how 20.04 has released and you still can't move the fricking ~/snap folder. Creating some generically named top-level folder in the users home directory is a straightforward fuck you to all users. Since 2017: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1575053 https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1575053
- JosephRedfern 6y agoYeah. That is what winds me up the most about snap. It is so... obnoxious! Why can’t it be .snap?! Or even better, something xdg compliant?
- jeroenhd 6y agoDang, that really sucks. I was planning on updating my desktop to 20.04 but after reading about Canonical pushing snaps and now this thread basically claiming that moving or renaming the directory is impossible because what is in my opinion a design flaw in the entire system design, I think I'll switch to Manjaro or Arch for my desktop instead. 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.
- mcpeepants 6y agoarch is really a pleasure to use on the desktop, especially if you're already comfortable with a rolling release distro.
- jeroenhd 6y agoI agree, I'm using Manjaro on my laptop and it works like a treat. I have read the horror stories of a botched Arch upgrade so I think I'll stick to the slightly-more-stable Manjaro but the ecosystem itself is very nice for the moderately familiar Linux user.
- 6y ago
- curt15 6y agoYep: https://forum.snapcraft.io/t/disabling-automatic-refresh-for-snap-from-store/707 https://forum.snapcraft.io/t/disabling-automatic-refresh-for...
- _jal 6y agoI guess users have been sufficiently beaten into submission that many of them will put up with software randomly quitting on them, but the idea that daemons should be snaps is doubly crazy. "Oh, Tomcat just updated itself, that's why we were down." I really have no idea what people are thinking sometimes.
- theossuary 6y agoI always resisted running Ubuntu in production, even when it was much easier to install the necessary software. When you pick a distro, you're picking their packaging and maintainer culture. I've always prefered CentOS for that reason. Even the little things, like installing a new package won't start/enable the services (because you should have a chance to configure it first) always came off as more pragmatic for system administration.
- jlgaddis 6y agoI 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: $ 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.preset.html https://www.freedesktop.org/software/systemd/man/systemd.pre... [1]: https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt https://people.debian.org/~hmh/invokerc.d-policyrc.d-specifi...
- avhception 6y agoI've got an ansible playbook that modifies my ~/.config/lxc/config.yml for certain deployment scenarios. 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).
- m-p-3 6y agoI came to the realization that my home server doesn't need Ubuntu, it needs Debian.
- avhception 6y agoEditing a config file for a program should not be more complicated than opening the file in your preferred editor, no matter your distro. Snaps break that. I can't understand why they would break such fundamental thing and seemingly don't care about it.
- m0xte 6y agoAll this shit actually drove me to NetBSD for my home server
- eternauta3k 6y agoI've thought of switching to Debian but I'd rather use a stripped-down Ubuntu so I can use PPAs.
- waltpad 6y agoYou had to install snap on a production server? 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.
- zorpner 6y agoThis is honestly probably an unexpectedly good heuristic -- remove anything pulseaudio depends on, and you'll likely get a more stable system.
- Reelin 6y agoIs Pulseaudio no longer viable using APT alone? One of the first things I do is excise Snap from the system entirely and install Flatpak. I had been planning to upgrade my daily driver to 20.04 in the very near future (I prefer LTS versions) but audio problems would be a complete deal breaker.
- corndoge 6y agoDoes anyone know if they fixed the bug where snaps don't work if your home directory isn't /home/<user>, or is on NFS?
- 5- 6y agoof course not, the only progress so far has been people coming up with horrifying workarounds: https://bugs.launchpad.net/snappy/+bug/1620771 https://bugs.launchpad.net/snappy/+bug/1620771
- yisonPylkita 6y agoMy god! Being unable to use snaps when you have “non-standard” home directory is ridiculous. What’s even more ridiculous is a response from snap developers - they marked this issue as “Won’t Fix”. 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
- petre 6y agoPeople will ditch snap and they'll end up using flatpak or something else just like the rest of the world. It happened with upstart and it then it happened with mir and unity. I uninstalled it on all my Ubuntu systems and put it on hold. No new Ubuntu installs, switched to Debian.
- deleted 6y ago[deleted]
- yrro 6y agoWhat the actual fudge? So my Asad AD trust users, whose home directories are /home/example.com/sam-account-name, are going to run into trouble when they upgrade to 20.04? I think I am going to have to start figuring out a plan to migrate them all over to RHEL...
- 6y ago
- deleted 6y ago[deleted]
- agentx3r 6y agoHear hear. I imagine for dogfooding, LXD is only packaged in snap, so we can't use apt as the source anymore. After migrating, an upstream push to a 'stable' LXD snap channel introduced a regression that borked our environments, and there was no way to: 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.
- simosx 6y agoCanonical packages LXD as a snap package. Other distributions can package LXD in their favorite packaging format, and some do. Some developers are trying to package for Debian. The work is in progress at https://wiki.debian.org/LXD https://wiki.debian.org/LXD
- zertrin 6y agoI've been looking forward for this work to come to something working for some time already, but it's been already 3 years I've eyed on it, is it now coming to something working "soon"?
- CameronNemo 6y agoDebian is a bad choice if you want to package go applications (or rust apps, for that matter). Debian requires that all those little static dependencies be individually packaged. Common container software like lxd, podman, and umoci are not found in Debian. 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.
- rawoke083600 6y agoAhh Gentoo :) I once build-from-source think it was called stage-1 install on a SBC(Single Board Computer) 486DX. I compiled well over 4 days :D
- kbknapp 6y agoSame! Unfortunately we have a system is more or less tethered to use of LXD. While other workloads have moved to CentOS or Red Hat systems, LXD is supremely broken on those systems (or any distro that uses SELinux). It's extremely frustrating to be tied to Ubuntu for this one reason. It's even more frustrating when one of the key selling points from Canonical is "cross distribution!" Which appears to only be true for basic cases, or in the sense of, "Sure it's cross distro if someone other than us is willing to put in the work for their distro!"
- lmeyerov 6y agoYEP. For various reasons, we want to run Ubuntu on a server. Reboots and autoupdating are hazards and bugs for us. Upgrades & fixes mean patching our containers and starting fresh servers. Instead of rebooting a running server, we delete it. Trying to use Ubuntu environments means having to add custom disable-reboot-upgrade-downtime init scripts that we do not trust across updates: will bumping a minor version break them 5 days later? Super bad for reputation. I rather be updating Ubuntu more frequently, not less! (Same-but-different for enforcing non-interactive mode on installs.)
- m463 6y agoIt's unfortunate that they don't realize they're alienating the very customers that have money and will be in it with them for the long term. 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)
- danmur 6y agoI'm using LXC from ubuntu packages for that very reason, got burned when a cluster upgraded automatically. I guess I must be very out of date if the debs no longer exist. 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.
- ChuckMcM 6y agoI get the idea behind snaps is that someone recognized that configuration management was a problem but didn't yet appreciate just how deep that problem goes. 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.
- axaxs 6y agoOn top of all of this bad behavior... I did try Snap to install Opera browser. Opera is written such that you need to put widevine libs in a certain directory for it to work. After tons of hacking and Googling, there is zero way to inject files into the file system of a Snap. I understand the security precautions, but that feels ridiculous. I left Ubuntu after more than a decade over their obsession with Snap.
- gdevenyi 6y agoSnaps also are completely broken for NFS mounted home and data directories with automount. Which is the classic corporate Linux deployment. Of course, systemd doesn't even support wildcard automount....
- inshadows 6y ago> By default, Snap applies updates and restarts Systemd services anytime it likes, and there's no way to turn this behavior off! For context: https://forum.snapcraft.io/t/disabling-automatic-refresh-for-snap-from-store/707 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.