The arch wiki is always a good place to check for these sorts of things, whether or not you use arch btw.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Next up: Learn how to create .service
file, you may be able to use it from the template provided.
Then learn about target
and unit
Find these on Youtube
Then .timer. Then .mount. Then .automount. Then .socket.
see systemd.unit(5), systemd.service(5), systemd.socket(5), systemd.device(5), systemd.mount(5), systemd.automount(5), systemd.swap(5), systemd.target(5), systemd.path(5), systemd.timer(5), systemd.slice(5), systemd.scope(5) systemd.link(5), systemd.netdev(5), systemd.network(5) and honorable mentions podman-systemd.unit .container, .volume, .network(...again), .kube, .image, .build and .pod
It seems even I have many many many things to learn still
Then .device and .boot and .home and .gov and .co.uk
- https://systemd.io/
- https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_systemd_unit_files_to_customize_and_optimize_your_system/assembly_working-with-systemd-unit-files_working-with-systemd#con_introduction-to-unit-files_assembly_working-with-systemd-unit-files
- https://www.freedesktop.org/software/systemd/man/latest/
- https://tadeubento.com/2023/systemd-hidden-gems-for-a-better-linux/
Systemd does a lot of stuff I guess it is easier to just lean based on what comes up / you need. There isn't a single path.
The man pages.
The official website has ton of documentation and external links: https://systemd.io/
- Credentials
- Desktop Environment Integration
- Portable Services Introduction
- ... and more
- Arch Linux wiki
- Debian wiki
- Gentoo wiki
- Ubuntu wiki
And here some tutorials:
- https://systemd-by-example.com/ - a tutorial with interactive examples
The best crash course I received was when I needed to translate my startup scripts into systemd services. The hands-on learning was priceless.
I always recommend people learning by doing. But playing around with system tools to see and learn how it works is a bit risky. However in a virtual machine this is probably a good idea to see how things work.
Write a couple of your own toy services as practice. Write a one-shot that fires at a particular time during boot, a normal service that would run a daemon and a mount service that fires after its dependencies are loaded (like, say, a bind mount that sets up a directory under /run/foo after the backing filesystem is mounted - I do this to make fast ext4 storage available in some parts of the VFS tree while using a btrfs filesystem for everything else.) You can also write file watcher services that fire after changes to a file or directory, I use one of those to mirror /boot/ to /.boot/ on another filesystem so it's captured by my system snapshots.
I'd start by reading the docs so you have some ideas about what services can do, then you'll find uses that you wouldn't have thought of before.