Home Explore Blog CI



man-pages

5th chunk of `init.man`
7c1308913ec70f8673b87e6146d248175e4d646dd40fdd210000000100000fa3
 --variable=systemdsystemunitdir. Other directories checked are /usr/local/lib/systemd/system and /lib/systemd/system. User configuration always takes precedence.  pkg-config systemd --variable=systemdsystemconfdir
           returns the path of the system configuration directory. Packages should alter the content of these directories only with the enable and disable commands of the systemctl(1) tool. Full list of directories is
           provided in systemd.unit(5).

       User unit directories
           Similar rules apply for the user unit directories. However, here the XDG Base Directory specification[6] is followed to find units. Applications should place their unit files in the directory returned by
           pkg-config systemd --variable=systemduserunitdir. Global configuration is done in the directory reported by pkg-config systemd --variable=systemduserconfdir. The enable and disable commands of the systemctl(1)
           tool can handle both global (i.e. for all users) and private (for one user) enabling/disabling of units. Full list of directories is provided in systemd.unit(5).

       SysV init scripts directory
           The location of the SysV init script directory varies between distributions. If systemd cannot find a native unit file for a requested service, it will look for a SysV init script of the same name (with the
           .service suffix removed).

       SysV runlevel link farm directory
           The location of the SysV runlevel link farm directory varies between distributions. systemd will take the link farm into account when figuring out whether a service shall be enabled. Note that a service unit with
           a native unit configuration file cannot be started by activating it in the SysV runlevel link farm.

SIGNALS
       SIGTERM
           Upon receiving this signal the systemd system manager serializes its state, reexecutes itself and deserializes the saved state again. This is mostly equivalent to systemctl daemon-reexec.

           systemd user managers will start the exit.target unit when this signal is received. This is mostly equivalent to systemctl --user start exit.target --job-mode=replace-irreversibly.

       SIGINT
           Upon receiving this signal the systemd system manager will start the ctrl-alt-del.target unit. This is mostly equivalent to systemctl start ctrl-alt-del.target --job-mode=replace-irreversibly. If this signal is
           received more than 7 times per 2s, an immediate reboot is triggered. Note that pressing Ctrl+Alt+Del on the console will trigger this signal. Hence, if a reboot is hanging, pressing Ctrl+Alt+Del more than 7 times
           in 2 seconds is a relatively safe way to trigger an immediate reboot.

           systemd user managers treat this signal the same way as SIGTERM.

       SIGWINCH
           When this signal is received the systemd system manager will start the kbrequest.target unit. This is mostly equivalent to systemctl start kbrequest.target.

           This signal is ignored by systemd user managers.

       SIGPWR
           When this signal is received the systemd manager will start the sigpwr.target unit. This is mostly equivalent to systemctl start sigpwr.target.

       SIGUSR1
           When this signal is received the systemd manager will try to reconnect to the D-Bus bus.

       SIGUSR2
           When this signal is received the systemd manager will log its complete state in human-readable form. The data logged is the same as printed by systemd-analyze dump.

       SIGHUP
           Reloads the complete daemon configuration. This is mostly equivalent to systemctl daemon-reload.

       SIGRTMIN+0
           Enters default mode, starts the default.target unit. This is mostly equivalent to systemctl isolate default.target.

       SIGRTMIN+1
           Enters rescue mode, starts the rescue.target unit. This is mostly equivalent to systemctl isolate rescue.target.

       SIGRTMIN+2
           Enters emergency mode,

Title: Systemd Directories, Signals, and Behavior
Summary
Systemd utilizes specific directories for user unit files, following the XDG Base Directory specification, and uses systemctl to manage unit enabling/disabling. If native unit files are absent, Systemd looks for SysV init scripts. It also considers SysV runlevel link farms to determine service enabling but cannot start services with native unit files using SysV runlevels. The systemd system manager reacts to various signals, such as SIGTERM for state serialization and re-execution, SIGINT to start the ctrl-alt-del.target unit (and triggering an immediate reboot if sent multiple times), SIGWINCH to start kbrequest.target, SIGPWR to start sigpwr.target, and SIGHUP to reload the daemon configuration. Other real-time signals cause systemd to enter specific modes like default, rescue, and emergency.