thoughts, comments, concerns on systemd? was having a convo w someone that’s on mx linux & it piqued my interest.

  • ryokimball@infosec.pub
    link
    fedilink
    arrow-up
    33
    arrow-down
    3
    ·
    4 days ago

    The fight was fought, and systemd won. If you’re looking to learn theory then by all means look into the alternatives, but if you’re wanting to use what’s in most systems then go with systemd.

  • mholiv@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    3 days ago

    If you are new to Linux I think it makes sense to use systemd. It’s the default for a reason. All major distros use it for a reason. It’s only a really small minority of very vocal people who are against it.

    If Debian and Fedora and Ubuntu and All the enterprise linuxes use the same thing, I think that says something.

    Despite claims to the contrary systemd is substantially faster and easier to use than its predecessor.

    It’s simpler and easier to use. Take a look at these examples. Service files are so so much easier to use and are much more robust than hundred line bash scripts.

    Systemd:

    [Unit]
    Description=OpenVPN tunnel for %i
    After=network-online.target
    Wants=network-online.target
    
    [Service]
    ExecStart=/usr/sbin/openvpn --config /etc/openvpn/%i.conf
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    

    Sysvinit

    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides:          openvpn
    # Required-Start:    $network $remote_fs
    # Required-Stop:     $network $remote_fs
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: OpenVPN service
    # Description:       Start or stop OpenVPN tunnels.
    ### END INIT INFO
    
    DAEMON=/usr/sbin/openvpn
    CONFIG_DIR=/etc/openvpn
    PID_DIR=/run/openvpn
    DESC="OpenVPN service"
    NAME=openvpn
    
    . /lib/lsb/init-functions
    
    start() {
        log_daemon_msg "Starting $DESC"
    
        mkdir -p "$PID_DIR"
    
        for conf in "$CONFIG_DIR"/*.conf; do
            [ -e "$conf" ] || continue
            inst=$(basename "$conf" .conf)
            pidfile="$PID_DIR/$inst.pid"
    
            if start-stop-daemon --start --quiet --background \
                --pidfile "$pidfile" --make-pidfile \
                --exec "$DAEMON" -- --daemon ovpn-$inst --writepid "$pidfile" --config "$conf"; then
                log_progress_msg "$inst"
            else
                log_warning_msg "Failed to start $inst"
            fi
        done
        log_end_msg 0
    }
    
    stop() {
        log_daemon_msg "Stopping $DESC"
        for pid in "$PID_DIR"/*.pid; do
            [ -e "$pid" ] || continue
            inst=$(basename "$pid" .pid)
            if start-stop-daemon --stop --quiet --pidfile "$pid"; then
                rm -f "$pid"
                log_progress_msg "$inst"
            else
                log_warning_msg "Failed to stop $inst"
            fi
        done
        log_end_msg 0
    }
    
    status() {
        for conf in "$CONFIG_DIR"/*.conf; do
            [ -e "$conf" ] || continue
            inst=$(basename "$conf" .conf)
            pidfile="$PID_DIR/$inst.pid"
            if [ -e "$pidfile" ] && kill -0 "$(cat "$pidfile" 2>/dev/null)" 2>/dev/null; then
                echo "$inst is running (pid $(cat "$pidfile"))"
            else
                echo "$inst is not running"
            fi
        done
    }
    
    case "$1" in
        start) start ;;
        stop) stop ;;
        restart) stop; start ;;
        status) status ;;
        *) echo "Usage: $0 {start|stop|restart|status}"; exit 1 ;;
    esac
    
    exit 0
    
  • namingthingsiseasy@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    3 days ago

    I don’t like systemd mostly because it gives Red Hat too much power over the Linux ecosystem. For example, udev and logind used to be independent components that were eventually merged into systemd, and the onus was put on the community to maintain their independent derivatives (eudev and elogind). systemd’s original developer (Lennart Poettering) has been very open about his intention to make life difficult for anyone that doesn’t adopt systemd (source and original quote).

    To me, systemd is the Google Chrome of Linux - it tries to make life easier and does a good job of that, but it’s also explicitly designed in such a way to push out all competitors. So I avoid it at all costs and prefer other distros like Devuan, Void, Alpine, Gentoo and so on. That said, I don’t do enough to contribute back to those projects, so I wish I were more helpful about it than I actually am :-(

    Regardless, this doesn’t mean that you need to do the same thing. If you’re new to Linux, use whatever makes you happy and your life easiest! Practically none of the non-systemd distros are particularly easy to set up and use (Devuan may be an exception, but is likely the only one). And besides, a lot of this stuff is very old, and Poettering hasn’t even worked at Red Hat for multiple years now.

    But do keep in mind that systemd was a very political topic and still poses a threat to the Linux ecosystem - anyone could take over the project and leverage it to make life difficult for anyone that doesn’t want to do things the Red Hat way. And since many of the major distros have made it the only option at this point, they’ll have no choice but to be dragged along with it. Keep that in mind as you gain more experience with Linux and think about trying alternatives.

    • moonpiedumplings@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      1 day ago

      Google Chrome of Linux

      It’s more like Chromium, the engine behind Chrome, to be precise. It eats up marketshare by essentially being anti-competitive, and making it more difficult for alternate engines to keep up with the fluctuating and undefined web standards.

      Poettering hasn’t even worked at Red Hat for multiple years now.

      No, he now works at Microsoft, which is famous for it’s Embrace, Extend, Extinguish strategy for consuming open source and open standards.

      But despite that, I’m actually not worried about systemd being taken over by a corporation and being completely used to dominate Linux. Unlike consumer software, where companies seem to be willing to take a step back and allow other corporations to monopolize a slice of the market dedicated to a usecase, corporations actually seem willing to share in the server space.

      Systemd also seems to be designed with a very specific philosophy in mind, which is vastly different from Chromiums “Alright, time for a new web standard that Firefox and Safari will have trouble implementing!”. Systemd, is essentially designed to replicate features of Kubernetes.

      Kubernetes is (buzzwords incoming), a clustered, highly available, multi tenant, declarative, service manager and job scheduler. To break down what that means:

      • Multi tenant: There can be different “users” on a Kubernetes cluster, which can be granually given access to different resources or capabilities
      • Declarative: All of the Kubernetes config, roles, users, and jobs, and can be declared as code, “yaml”.
      • Service Manager: Kubernetes can run services, specifically containers (this is important to note).
      • Job Scheduler: Users can start short or long running “jobs”
      • Clustered: Kubernetes can combine resources from more than one physical or virtual server into a cluster. It does not literally combine them, but rather it shifts around services and jobs to make more room. Some services can take direct advantage of this though, where running multiple instances of them does let you combine resources.
      • Highly Available: If any single “node” of a kubernetes cluster goes down, the services Kubernetes runs, and Kubernetes itself, stay active.

      Systemd is essentially trying to Kubernetes, without the clustering and highly available parts of Kubernetes. It has:

      • Multi tenant: This is what polkit, and logind do. They give users the ability to run long running services, but control the resources and capabilities those users who have access to
      • Declarative: Systemd doesn’t use yaml like kubernetes, but instead it uses the ini file format — but almost everything in Systemd can be declared as an ini file.
      • Service Manager: This one is mostly self explanatory — but what’s important to note is the focus that systemd has on containers. There is support for OCI containers via podman quadlets, but Systemd also has it’s own container format that it can launch rootlessly, and built on top of this is systemd portablectl, which is essentially an application container format, similar to docker. You tell systemd to run a service with a root image of one of these containers, and it does so.
      • Job Scheduler: Timers, but it’s not a full featureset. Perhaps Systemd doesn’t care about this because people can simply run commands after they are ssh’ed in.

      Now, based on the assumption, I can make some predictions about what features systemd will add next. Maybe these are wrong, but eh.

      • Firewall service: Kubernetes has something akin to a firewall, but mostly this prediction is because Linux doesn’t really have a declarative firewall. Systemd kinda already has something similar but it’s not complete.
      • More advanced manipulation of user resource and capability constraints. It looks like there is some simple cgroup stuff, but I do think we are going to eventually see Seccomp and other restrictions.
      • A “container repo” for portable/nspawn services. I think they used to have one for OS containers for machinectl, but I can’t find it. But If they are actually trying to be Kubernetes, then I would expect to see a setup where you can have a file declaring a service, and then it pulls the container image for that service and then runs it.

      Now, “one node Kubernetes” probably isn’t the best choice for a normal server or desktop distro. (Actually I love Kubernetes as a server but that’s a different discussion). But it’s the most popular choice, so I think people should be aware of the architecture and intent. Especially if you dislike systemd, you should understand what changes it makes, why, and how they will impact the Linux world.

      Kubernetes handles everything, except for booting the system, being a kernel, and starting itself up, and connecting to the network. Core services like DNS are actually containers ran within Kubernetes. The “firewall” (network policies) are also containers. If systemd truly wants to be Kubernetes, it seems to be trying to be even more, where consuming things like booting with systemd-boot and connecting to the network with systemd-network. I’m not personally concerned, because Kubernetes has consumed the server world and that hasn’t seem to have gone wrong, but I can understand why people would be concerned.

      @R3D4CT3D@midwest.social

      Or is it: @R3D4CT3D@midwest.social

  • QuizzaciousOtter@lemm.ee
    link
    fedilink
    arrow-up
    6
    ·
    3 days ago

    I just want to say that I love systemd. Working with services and timers is just a pleasure. Handling dependencies is sooo much easier. This is just my opinion, but yeah, I can’t imagine dealing with SysV in 2025.

    • Deifyed@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      This confuses me. I have a terrible experience each and every time I try to make a unit fine. To be fair, it’s often a long time between each time I do

      • RangerHere@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        3 days ago

        I had similar issue. Every time I was writing a systemd file, I would have forgotten what I previously learned.

        These days I just make deepseek/changpt do it. 90% of the time they get it right. Even if they get it wrong, you end up with a file that will be perfect with a line or two changes.

        • Deifyed@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          Yeah probably easier now with AI. I just remember wishing it was more like the container orchestration tools

  • Omega@discuss.online
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    4 days ago

    Are you someone who just want to use your computer?

    Pick systemd

    Are you someone who likes to experiment?

    Then it won’t really matter

  • lnxtx (xe/xem/xyr)@feddit.nl
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    4 days ago

    After 12 years (me converting in 2013 to systemd on Arch BTW)
    I can say we finally have standardization between major distributions.
    OpenRC, SysV or Upstart…? How to do things…

    Real boot time improvement.
    Real multiple instances of the same service (service-name@xyz.sevice).
    Drop-in overrides. Builtin DNS cache, timesync, syslog, cron (kinda, timers have new syntax),
    cgroups, boot manager, network manager, containers, and more…

    Not a Unix or KISS philosophy, but come on, we need a fresh blood.
    There is no “next gen” kernel/operating system in the horizon.

    I have Devuan and PostmarketOS (Alpine with desktop environment),
    I feel like a caveman. Things which are easy to do in systemd, in OpenRC are not trival.
    OpenRC in Gentoo is not the same as in Devuan.

    Also, more and more software is systemd-centric.

    However.
    I encourage you to discover Linux without systemd first (extra layer of abstraction may be difficult during learning).

  • HayadSont@discuss.online
    link
    fedilink
    arrow-up
    7
    arrow-down
    3
    ·
    4 days ago

    If you’re still (relatively) new to Linux and are mostly interested in “just works”, then you simply can’t go wrong with systemd. It has (for better or worse) become the de facto standard on Linux and is therefore often assumed to be present. Hence, actively resisting it might be ‘costly’. Therefore, you should carefully consider whether it’s worth straying from the beaten path. Like, what do you hope to achieve?

    As for the elephant in the room, what alternative can even put up a fight? While I’d be the first to admit that systemd’s design ethos leaves a lot to be desired; it’s so feature-rich that I’ve yet to find any distro that puts good use to (almost) all of them. But, including everything and the kitchen sink does make it hard for its competitors to compete whenever it matters; perhaps it’s one of the key reasons why systemd is as reliable as it is OR why attempting to replace systemd on Fedora/NixOS/openSUSE is a nonstarter. (Being founded and funded by Red Hat doesn’t hurt either. Nor does it hurt when its main developer is on Microsoft’s payroll.)

    Though, even if I don’t see the likes of OpenRC/runit/sysvinit ever compete with systemd in terms of capabilities, I am cautiously optimistic for dinit and s6.

    LOL, who am I kidding, systemd will (probably) only be dethroned whenever its PipeWire/Wayland is introduced.

    • [R3D4CT3D]@midwest.socialOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 days ago

      this is great information! i’m relatively new, so it is nice to hear from users & not just documentation & what not.

  • MehBlah@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    3 days ago

    systemd is still a solution in search of a problem. I use it but sysV/init also works just fine.

  • GolfNovemberUniform@infosec.pub
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    2
    ·
    3 days ago

    Systemd is objectively slow so I would prefer avoiding it when possible. I can’t do it myself though because I’m not very familiar with management of the alternative solutions.

          • GolfNovemberUniform@infosec.pub
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 days ago

            That’s the same as if I said “Cyberpunk 2077 can offer 240 FPS in native 4K”. Sure, but only on a professional PC with many GPUs.

            • Fizz@lemmy.nz
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 day ago

              Not really. The optimizations arent rocket science and distros implement them already.

                • Fizz@lemmy.nz
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  1 day ago

                  You dont have it with any systems because youre running grub most likely. Systemd boot can skip that entire process and start everything up in parallel.

                  Use systemd-analyze blame to see what’s making your boottime take so long. Its likely spending ages trying to mount a drive or something.

        • ArcaneSlime@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          3 days ago

          Meanwhile my system (with the d) boots in less than 30sec. How fucking fast do you need it to be? Boot before you turn it on or something?

          • GolfNovemberUniform@infosec.pub
            link
            fedilink
            English
            arrow-up
            2
            ·
            3 days ago

            In case you didn’t know, boot time also highly depends on the hardware. The worse the hardware is, the longer are boot times and the bigger is the difference between init systems.

            • ArcaneSlime@lemmy.dbzer0.com
              link
              fedilink
              arrow-up
              2
              ·
              3 days ago

              Well tbf I’m using a framework now, but on my last laptop, a 2014 toshiba satellite with an i5 and 4gb of ram, it still started up in less than 30sec. Last time I booted it was when the framework 16s shipped, so not that long ago. What, you running a pentium II with 8 megs of RAM or something?

              • GolfNovemberUniform@infosec.pub
                link
                fedilink
                English
                arrow-up
                1
                ·
                3 days ago

                I had 2 testing devices: one with 4 gb of RAM and one with 8 gb. None of them are as powerful as anything with an i5 but I think they’re decent enough.

                • ArcaneSlime@lemmy.dbzer0.com
                  link
                  fedilink
                  arrow-up
                  2
                  ·
                  3 days ago

                  Well alright, but that’s a case of decade+ old hardware that may need something lighter on resources depending on the processor. 4gb of ram is totally enough to boot systemd systems quickly, so the processor may be a bit of your bottleneck there. But that’s not exactly unexpected, for something like that you’d likely be looking for a lighter distro over one that is more current, like puppy, antix, slax, something meant for that application, it’s just a case of picking the correct tool for the job.