The question I have here is to understand
basic.target
upon booting my CentOS 7 server.
A few things I think I know correctly about Systemd:
* Requires=unit2
means some unit1
will only be activated if unit2
succeeds all the way
* Wants=unit2
means some unit1
will be activated regardless whether
the listed unit2 succeeds or not
* After=unit2
means some unit1
will only be activated after unit2 is activated
* Things in Systemd usually starts out in parallel
* .target
is mainly for "grouping" and "ordering" (see [systemd.target])
* In reality, basic.target
must be activated (along with everything it required and wanted) before reaching multi-user.target
(which is the default runlevel for a server)
All right, I hope so far I am right.
---
Now, looking basic.target
:
$ sudo cat /usr/lib/systemd/system/basic.target
[Unit]
Description=Basic System
Documentation=man:systemd.special(7)
Requires=sysinit.target
After=sysinit.target
Wants=sockets.target timers.target paths.target slices.target
After=sockets.target paths.target slices.target
So now my interpretation is:
1. basic.target
will only be activated **after** sysinit.target
has succeeded
2. Furthermore, basic.target
desires to have sockets.target
and etc to be running
3. The additional After=
means, okay, please only activate basic.target
after sockets.target
, paths.target
, and slices.target
are activated. It's okay for timers.target
to fail.
4. Then why not combine two After=
into one? Why not use Require=
instead of Wants
(except timers.target
)?
Asked by CppLearner
(499 rep)
Aug 21, 2019, 07:53 PM
Last activity: Aug 5, 2025, 10:05 AM
Last activity: Aug 5, 2025, 10:05 AM