1SYSTEMD-HALT.SERVICE(8) systemd-halt.service SYSTEMD-HALT.SERVICE(8)
2
3
4
6 systemd-halt.service, systemd-poweroff.service, systemd-reboot.service,
7 systemd-kexec.service, systemd-shutdown - System shutdown logic
8
10 systemd-halt.service
11
12 systemd-poweroff.service
13
14 systemd-reboot.service
15
16 systemd-kexec.service
17
18 /usr/lib/systemd/systemd-shutdown
19
21 systemd-halt.service is a system service that is pulled in by
22 halt.target and is responsible for the actual system halt. Similarly,
23 systemd-poweroff.service is pulled in by poweroff.target,
24 systemd-reboot.service by reboot.target and systemd-kexec.service by
25 kexec.target to execute the respective actions.
26
27 When these services are run, they ensure that PID 1 is replaced by the
28 /usr/lib/systemd/systemd-shutdown tool which is then responsible for
29 the actual shutdown. Before shutting down, this binary will try to
30 unmount all remaining file systems, disable all remaining swap devices,
31 detach all remaining storage devices and kill all remaining processes.
32
33 It is necessary to have this code in a separate binary because
34 otherwise rebooting after an upgrade might be broken — the running PID
35 1 could still depend on libraries which are not available any more,
36 thus keeping the file system busy, which then cannot be re-mounted
37 read-only.
38
39 Immediately before executing the actual system
40 halt/poweroff/reboot/kexec systemd-shutdown will run all executables in
41 /usr/lib/systemd/system-shutdown/ and pass one arguments to them:
42 either "halt", "poweroff", "reboot" or "kexec", depending on the chosen
43 action. All executables in this directory are executed in parallel, and
44 execution of the action is not continued before all executables
45 finished.
46
47 Note that systemd-halt.service (and the related units) should never be
48 executed directly. Instead, trigger system shutdown with a command such
49 as "systemctl halt" or suchlike.
50
52 systemd(1), systemctl(1), systemd.special(7), reboot(2), systemd-
53 suspend.service(8)
54
55
56
57systemd 219 SYSTEMD-HALT.SERVICE(8)