5 ms·
What would you prefer to have in Nix instead of systemd?
by xyzzyz 5y ago
What would you prefer to have in Nix instead of systemd?
- b9be520d93286 5y agoI would prefer OpenRC, runit or something similar.
- md8z 5y agoThose would probably be not so great matches for NixOS because they don't support the container stuff that systemd does, you would be throwing all that out.
- NewJazz 5y agoSome people don't care. Some people want their boot ordering software and container runtime software to live in different code bases.
- md8z 5y agoWith cgroupsv2 there seems to be very little benefit to doing that since the container runtime needs to sit at the top of the process tree anyway, so I'm not sure I understand what the purpose of that would be or why you would want that. If you were using containers to run services then I can't really think of a situation where you wouldn't also want it as part of the boot ordering process, so your services will just have it working immediately upon boot.
- NewJazz 5y agoThat is not true at all about cgroup2. Also think outside the box. Not everyone is using cgroups and namespaces. Some people are out there using gvisor, or KVM, or FreeBSD jails.
- md8z 5y agoI'm not sure what you mean it's not true, AFAIK that constraint was the main issue with getting Docker moved over to cgroupsv2. (Edit: some background here https://github.com/opencontainers/runc/pull/2113 https://github.com/opencontainers/runc/pull/2113) It's fixed now though so everything should work fine with systemd. If you aren't using cgroups and namespaces then you probably don't get much benefit from running a system like NixOS on bare metal either, so I'm having trouble figuring out what your use case would be. Any other immutable Linux setup will do, it might even be less hassle. Those other things you mention are confusing to me, gvisor and KVM are mostly orthogonal to container management. And FreeBSD jails don't work on Linux.
- NewJazz 5y agoNix works on more than just linux. Google Cloud uses gvisor for their K8s offering; AWS and Fly.io use firecracker for their container offerings. Cgroups in v2 can be delegated easily and cleanly. As well as namespaced. Systemd or no systemd. Systemd just makes your life harder if you want to do rootless containers without integrating with them.
- md8z 5y ago"Nix works on more than just linux." IIRC the GP comment was asking about NixOS, not Nix. If you have everything already going through managed K8s or firecracker then I don't understand what you are using NixOS for. You could just install Nix on some other distribution that uses whatever init/container setup you want. "Cgroups in v2 can be delegated easily and cleanly. As well as namespaced." Right but none of those other things that were mentioned support cgroups delegation at an OS service level, only systemd does. Unless they have added this recently and I missed it. And if you're just using this to run a hypervisor then you're bypassing all that completely. I don't see what you mean systemd makes it harder, you have to do basically the same process in any container manager if you want delegation. This is part of the design of cgroupsv2, it's not something systemd came up with. I'm sorry if I'm asking stupid questions but I honestly am really confused what your use case is, and your explanations are just making me more confused, so maybe something got lost here.
- NewJazz 5y agoI've been running Upstart (well, a fork I maintain) for over 2 years on my laptops and SBC. I'd like to use that. TBH I think NixOS might make it easier than other distros to run a custom init. I just haven't gotten around to importing my configs into a nix derivation.
- md8z 5y agoIf you have a parser for systemd unit files then you might have a chance to get that to work. If the whole reason you're doing it is to migrate back to upstart's syntax then it seems that would be not so useful, you might as well go in the other direction: write an upstart generator for systemd, and then you can just plug that into ordinary NixOS. Edit: Actually I think at some point NixOS did support upstart? Not sure whatever happened to that.
- deleted 5y ago[deleted]
- NewJazz 5y agoI'm not planning on working on anything related to systemd in the near future. If anything, I will write a config generator/type spec for startup/Upstart in Nix.
- md8z 5y agoUnfortunately I think you probably will have to work on it if you want to not break existing configurations, so maybe NixOS is not for you. You could try alpine possibly? But with that you will have to do the same with init.d, so it's going to be somewhat of an uphill battle either way I guess. This is generally why I would discourage maintaining a service manager outside of an established distro, I tried to do it for about the same amount of time as you and it became not worth it. Upstart in particular has been basically entirely replaced by systemd.
- NewJazz 5y agoI already use upstart on void no problem. Alpine would be a similar deal with me just managing the configs as raw text files via rsync. In fact my fork is already packaged in Alpine. A few people use it as a session manager for sway. There is no chance that my Nix changes would affect existing configurations. They would be completely self contained.
- josephcsible 5y agoLiterally any other init system. Maybe OpenRC, runit, or upstart? I'd even prefer to be stuck with sysvinit forever instead.