Need help understanding systemd targets
by Felthorn3 from LinuxQuestions.org on (#5JWEB)
Learning about systemd at the moment and I get the idea that targets are equivalent to run-levels or "states" that the system needs to reach in order to move forward to the necessary state(i.e. graphical.target = runlevel 5 and has a tree of dependencies to get to that point per the man file, also https://opensource.com/article/17/2/...ot-and-startup has it outlined). However, my issue is when looking at a lot of these dependent .target files, they don't look like they really do anything. For example, local-fs.target is high up on the tree and in my mind I'm thinking "okay this must have a lot of stuff in it since it has to do a lot" but when I read the file contents, nope, it doesn't look like it "does" anything. It has the following content:
[Unit]
Description=Local File Systems
Documentation=man:systemd.special(7)
DefaultDependencies=no
Conflicts=shutdown.target
After=local-fs-pre.target
Basically all I garner from this is that is the Local File System, it has a man page, has no default dependencies, can't run in parallel with shutdown.target, and has to exist after local-fs-pre.target. I'm reminded of the scene in 'Office Space' where the one worker is asked "What would you say that ya do around here?". What is the actual purpose of files like this that don't call any processes/services to run? In this instance, local-fs-pre.target has the following since it has to happen before the .target above:
[Unit]
Description=Local File Systems (Pre)
Documentation=man:systemd.special(7)
RefuseManualStart=yes
Again....this doesn't appear to "do" anything. Why is this so unintuitive? I'm really struggling to get the gist of how this integrates with services, i.e. what I assume are binaries executed via systemd reading .service files.
Please help :(
[Unit]
Description=Local File Systems
Documentation=man:systemd.special(7)
DefaultDependencies=no
Conflicts=shutdown.target
After=local-fs-pre.target
Basically all I garner from this is that is the Local File System, it has a man page, has no default dependencies, can't run in parallel with shutdown.target, and has to exist after local-fs-pre.target. I'm reminded of the scene in 'Office Space' where the one worker is asked "What would you say that ya do around here?". What is the actual purpose of files like this that don't call any processes/services to run? In this instance, local-fs-pre.target has the following since it has to happen before the .target above:
[Unit]
Description=Local File Systems (Pre)
Documentation=man:systemd.special(7)
RefuseManualStart=yes
Again....this doesn't appear to "do" anything. Why is this so unintuitive? I'm really struggling to get the gist of how this integrates with services, i.e. what I assume are binaries executed via systemd reading .service files.
Please help :(