4 ms·
systemd itself is also large in storage size(8MB?), which is why openwrt has its own procd replacements, and yocto is not default to systemd either due to this.
by synergy20 2y ago
systemd itself is also large in storage size(8MB?), which is why openwrt has its own procd replacements, and yocto is not default to systemd either due to this. additionally, systemd does not work well with musl which is very popular in embedded linux.
- cyberax 2y agosystemd binary is around 1.5Mb, with the shared libsystemd it's around 2.5Mb. Both can be reduced by not including compressors (the infamous libz), audit libraries, SELinux, etc. The minimum binaries size that can be obtained by trivial removals is around 2Mb. OpenWRT should just stop being stubborn and integrate it. They dropped support for 4Mb devices loooooong ago, and recently bumped the minimum specs to 16Mb. > systemd does not work well with musl which is very popular in embedded linux. Systemd can work with musl with a small compatibility shim, I did it about 9 years ago. Somebody did that again: https://catfox.life/2024/09/05/porting-systemd-to-musl-libc-powered-linux/ https://catfox.life/2024/09/05/porting-systemd-to-musl-libc-...
- simoncion 2y ago> OpenWRT should just stop being stubborn and integrate it. Why? If it fails to provide benefits commensurate to the effort required to integrate it, then there's no reason to do the work. OpenWRT is for routers and access points... devices which usually have a fixed [hardware] configuration, and very little need for the absurdly-complex (and in my professional experience, often subtly buggy) event-driven systems that systemd provides. "Every system everywhere gets to use the same unit files" isn't a significant benefit in practice... EVERYTHING that needs nontrivial pre-/post- start/stop verification and/or configuration has systemd run a shell script (or other such helper) anyway... so you only get to just write a unit file and call it a day in the most trivial of cases.
- cyberax 2y agoOpenWRT is a mess. It started as a small distro for routers, but it stopped being that long ago. Now it can host telephony services, full-blown Docker orchestration systems, etc. So you get all the pleasures of complex systems running on antiquated infrastructure. > so you only get to just write a unit file and call it a day in the most trivial of cases. What "start/stop verification"? Give examples, please. Systemd natively supports device dependencies, network status, other services, etc. It's a very rare case when you _need_ shell in systemd.
- simoncion 2y ago> Now it can host telephony services, full-blown Docker orchestration systems, etc. What features that systemd provides that aren't provided by openrc, runit, monit, openrc's init system, etc, etc, etc that are needed by software like Asterisk, Docker/runc, Kubernetes, and similar? If what OpenWRT is running works fine to bring that up, then systemd doesn't have any relevant compelling features that aren't provided by another init system. Switching away from something just because it's "antiquated" is a great resume-building tactic, but it's a pretty poor strategy when your objective is to keep things that have been working working with a minimum of effort. > What "start/stop verification"? Give examples, please. One example (out of many) are pre-start, pre-stop, and pre-restart configuration file correctness verification so that a typo or thinko doesn't bring a service down. A concrete example of this is Gentoo's running of 'named-checkconf' in BIND 9's service file [0]. Gentoo's BIND 9 systemd unit file [1] tries, but probably does not do the same thing... I don't know if 'ExecStartPre' runs before systemd brings down a service on a 'restart' action, but I bet you that it definitely does not run on service stop. I just checked and Ubuntu 22 does NOT do this sort of checking for its bind9 package, which is pretty wild. > It's a very rare case when you _need_ shell [or other such helpers] in systemd. Then you're either running "seatbelts off" (maybe without even knowing that you are), or you rarely deal with anything nontrivial. This need comes up a LOT in my day-to-day. [0] <https://gitweb.gentoo.org/repo/gentoo.git/tree/net-dns/bind/files/named.init-r15#n93 https://gitweb.gentoo.org/repo/gentoo.git/tree/net-dns/bind/...> [2] [1] <https://gitweb.gentoo.org/repo/gentoo.git/tree/net-dns/bind/files/named.service-r2 https://gitweb.gentoo.org/repo/gentoo.git/tree/net-dns/bind/...> [2] You might look at that file and be like "wow, TL;WR", but do try to notice how much of that file is dedicated to creating useful, human-readable status messages and error messages with good corrective instructions. If you care at all about your sysadmins, that complexity has to go somewhere, and that somewhere cannot be inside a systemd unit file... systemd just doesn't provide the features required to do that (and it would be kind of insane for the devs to even try).
- cyberax 2y ago> What features that systemd provides that aren't provided by openrc, runit, monit, openrc's init system, etc, etc, etc that are needed by software like Asterisk, Docker/runc, Kubernetes, and similar? Dependencies, watchdogs, start only when the given network interfaces are available, declarative configuration so that can be partially customized, etc. > If what OpenWRT is running works fine Unless you try to update it. And end up with merge conflicts in the /etc directory. And then it stops booting, and you have to get in via the serial port. No, OpenWRT is most definitely not fine. It's stuck in the past, and doesn't support automated rollback, configuration management, etc. > A concrete example of this is Gentoo's running of 'named-checkconf' in BIND 9's service file [0] Wow, what a... But named config has always been a disaster zone. With systemd _none_ of that crap is needed. It can use its own namespacing and cgroup support to ensure that BIND9 can't read outside of its allowlisted tree. If you want to run /usr/bin/named-checkconf, then it's just an ExecStartPre directive in the unit file. And unlike SysV that just fails to run and forces you to dig into the logs, systemd provides you a nice status saying that the pre-exec had failed. > You might look at that file and be like "wow, TL;WR", but do try to notice how much of that file is dedicated to creating useful, human-readable status messages and error messages with good corrective instructions. Yeah, and hanging indefinitely, forcing me to do a trip to the datacenter at night (true story): https://lwn.net/Articles/619565/ https://lwn.net/Articles/619565/
- jalgos_eminator 2y agoOpenWRT is VERY sensitive to firmware size. I developed for a device with 16 MB flash that had both a normal (~11 MB) and recovery firmware (~3MB) on flash. The rest of flash was used for persistent storage, bootloaders, and calibration data. This is very common for older routers and APs which is the whole reason that OpenWRT exists.
- cyberax 2y agoWell, OpenWRT doesn't even officially support devices with less than 16Mb of flash anymore: https://openwrt.org/toh/views/toh_available_16128 https://openwrt.org/toh/views/toh_available_16128 > The rest of flash was used for persistent storage, bootloaders, and calibration data. So you couldn't spare around 1Mb of compressed flash or 2Mb of uncompressed flash for systemd? > This is very common for older routers and APs which is the whole reason that OpenWRT exists. That hasn't been the case in quite some while. And it won't matter anymore, there is no price difference between 32Mb and 64Mb NOR or NAND flash. It's literally the same cost.
- jalgos_eminator 2y ago> So you couldn't spare around 1Mb of compressed flash or 2Mb of uncompressed flash for systemd? Absolutely not. > That hasn't been the case in quite some while These routers and APs still exist and are in use. Yes, they are 10+ years old, but they're still out there. One of the main goals of OpenWRT is to support legacy networking hardware that vendors abandoned.
- cyberax 2y ago> Absolutely not. So basically, you're dealing with devices that use obsolete hardware and are designed to be extra-brittle (no safety margin), with a built-in planned obsolescence (what if the new update requires just a bit more space for "calibration data"?). Got it. sysvinit indeed fits perfectly. Make the system extra unreliable, to provide a stimulus to buy a newer version. > One of the main goals of OpenWRT is to support legacy networking hardware that vendors abandoned. And OpenWRT abandoned this goal. OpenWRT also can do nothing about firmware vulnerabilities in the old WiFi chipsets. Moreover, 10 years ago, systems with 32Mb were already common.