this post was submitted on 12 Nov 2023
529 points (94.8% liked)

linuxmemes

21291 readers
1923 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack members of the community for any reason.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, and wants to interject for a moment. You can stop now.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't fork-bomb your computer.

    founded 1 year ago
    MODERATORS
     

    I use plasma, BTW

    you are viewing a single comment's thread
    view the rest of the comments
    [–] loo@lemmy.world 20 points 1 year ago (4 children)

    I don't even know what systemd is ☠️

    [–] topinambour_rex@lemmy.world 49 points 1 year ago (1 children)

    It is between systemc and systeme

    [–] vettnerk@lemmy.ml 15 points 1 year ago* (last edited 1 year ago) (1 children)

    Oversimplified: It's the serv8ce that handles starting and stopping of other services, including starting them in the right order after boot. Many people hate it because of astrology and supersticion. Allegedly it's "bloated". But still it has become the standard on many (most?) distros, effectively replacing init.

    I like init. It's simple. I like systemd as well. It's convenient. Beyond that i don't have very strong feelings on the matter.

    Also, see important answer by topinambour-rex.

    [–] drugo@sh.itjust.works 8 points 1 year ago* (last edited 1 year ago) (1 children)

    I think the arguments against the "bloat" are not towards systemd as an init system, but rather are because systemd does so many things other than being an init system. I also don't mind systemd, but I absolutely hate systemd-resolved. I do not want my init system to proxy DNS queries by setting my resolv.conf to 127.0.0.53. Just write systemd- and press tab, that's "the bloat". I'm not saying that the systemd devs should not develop any new tools, but why put them all inside one software package? systemd-homed is cool, but useless for 99% of users. Same with enrolling FIDO2 tokens in a LUKS2 volume with systemd-cryptenroll. Far from useless or "bad", but still bloat for an init system.

    [–] vettnerk@lemmy.ml 6 points 1 year ago* (last edited 1 year ago)

    Now that you mention it, I find systemd messing with my DNS settings incredibly annoying as well, so I can't help but agree on that point. At this production system at work, when troubleshooting, I often need to alter DNS between local, local (in chroot), some other server in the same cluster, and a public one. This is done across several service restarts and the occasional reboot. Not being able to trust that resolv.conf remains as I left it is frustrating.

    On the newest version of our production image, systemd-resolvd is disabled.

    [–] callyral@pawb.social 11 points 1 year ago (1 children)

    • systemd is an init system commonly used in distros like Linux Mint, Arch, Manjaro, Ubuntu, Debian, etc.

    • init systems have a process id of 1 and manage services like a login manager, network, firewall service, etc.

    • a process id is assigned to every process in a linux system.

    the average user usually doesn't worry about the init system, although more experienced/techy users may care about it.

    [–] ChunkMcHorkle@lemmy.world 4 points 1 year ago* (last edited 1 year ago) (1 children)

    Thank you, Callyral. I didn't know either. But now I'm trying to learn Linux again after 30 years of not touching it, so this is helpful.

    If I may ask an additional possibly stupid question (coming from Windows/Mac): as an init system in Linux, after you get past BIOS and POST at power up, is systemd also responsible for the initial OS software boot process (the "bootstrap" or Boot Manager in DOS/Windows) or is that another process altogether?

    Or, asked another way, does systemd load the Linux kernel, and if not, what does?

    Just so you know, I have no real skin in this game yet; I'm just trying to figure out where systemd starts and stops so that I can follow the [endless] debate, lol.

    [–] dan@upvote.au 3 points 1 year ago* (last edited 1 year ago) (1 children)

    Or, asked another way, does systemd load the Linux kernel, and if not, what does?

    Immediately after the BIOS/POST, the first thing that starts is the boot loader. This is usually a piece of software called GRUB. There's a part of GRUB in the Master Boot Record on the drive, that the loads the rest of GRUB from /boot. /boot has to be a basic partition so that the MBR code can mount it, so for example if you use something a bit fancier (like LVM) then you'll usually have a separate small ext2 or FAT partition just for /boot.

    GRUB shows a list of available kernels, and other operating systems (if any are installed), based on a config in /boot.

    Once you select a kernel to boot (or wait a few seconds for it to automatically choose the default option), it starts loading the kernel. There is a small disk image called the "initial ramdisk" in /boot, usually with a name like initrd or initramfs. This is a small ramdisk that contains all the drivers needed to mount your root partition - for example, drive drivers (NVMe, SATA, etc), file system drivers (ext4, ZFS, XFS, etc), LVM, RAID drivers if needed, and so on. If the root disk is on an NFS network share (not as common any more, but still doable), it also needs to contain network drivers for your network card. It also contains a few basic utilities, usually provided by BusyBox.

    Some Linux distros (such as Debian) build a custom initramfs, whereas others (like Fedora) have a generic one containing all possible drivers.

    The initial ramdisk then mounts the root partition and hands control over to the Linux kernel, which starts actually booting the OS. The very first process the kernel starts running is the init process, which these days is usually systemd but can be a different one like sysvinit or runit.

    Hope that helps :)

    [–] ChunkMcHorkle@lemmy.world 2 points 1 year ago

    Okay, yeah. This makes much more sense now. I really appreciate it. I've been seeing the GRUB menu in LiveUSB boots but didn't understand that it was part of the initial boot process for general Linux systems (for whatever reason I had it stuck in my head that it was just for USB booting). And you've placed systemd exactly where it makes sense to me as the init process for that OS.

    That is extremely helpful. Thank you so much for taking the time to write the entire boot order, because it just got crystal clear for me. Much appreciated!

    [–] cyanarchy@sh.itjust.works 2 points 1 year ago

    System deez nuts