From: Yu Watanabe Date: Mon, 21 Apr 2025 00:47:04 +0000 (+0900) Subject: units: drop runlevel[0-6].target X-Git-Tag: v258-rc1~58^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e58ba80a40fb6e96543d56774a5bc5aa9cdadbf3;p=thirdparty%2Fsystemd.git units: drop runlevel[0-6].target --- diff --git a/docs/FAQ.md b/docs/FAQ.md index 6f2db49caa9..45ba2d0d747 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -11,13 +11,7 @@ Also check out the [Tips & Tricks](/TIPS_AND_TRICKS)! **Q: How do I change the current runlevel?** -A: In systemd runlevels are exposed via "target units". You can change them like this: - -```sh -# systemctl isolate runlevel5.target -``` - -Note however, that the concept of runlevels is a bit out of date, and it is usually nicer to use modern names for this. e.g.: +A: The concept of runlevels is obsolete. A set of target units are exposed that carry similar semantics, e.g. runlevel 5 -> `graphical.target`: ```sh # systemctl isolate graphical.target diff --git a/man/systemd-sysv-generator.xml b/man/systemd-sysv-generator.xml index e198c2b7a3c..f5a9889e587 100644 --- a/man/systemd-sysv-generator.xml +++ b/man/systemd-sysv-generator.xml @@ -49,10 +49,6 @@ Note that compatibility is quite comprehensive but not 100%, for more details see Compatibility with SysV. - SysV runlevels have corresponding systemd targets - (runlevelX.target). The wrapper unit that is generated - will be wanted by those targets which correspond to runlevels for which the script is enabled. - systemd does not support SysV scripts as part of early boot, so all wrapper units are ordered after basic.target. diff --git a/man/systemd.special.xml b/man/systemd.special.xml index 3e5e90cae85..d5420e9c2e2 100644 --- a/man/systemd.special.xml +++ b/man/systemd.special.xml @@ -73,10 +73,6 @@ remote-fs.target, rescue.target, rpcbind.target, - runlevel2.target, - runlevel3.target, - runlevel4.target, - runlevel5.target, shutdown.target, sigpwr.target, sleep.target, @@ -627,9 +623,6 @@ systemd-logind8's org.freedesktop.login1.Manager.PowerOff D-Bus method directly. - - runlevel0.target is an alias for - this target unit, for compatibility with SysV. @@ -646,9 +639,6 @@ See systemd-reboot.service8 for further details of the operation this target pulls in. - - runlevel6.target is an alias for this target unit, for compatibility - with SysV. @@ -707,28 +697,11 @@ multi-user.target, this target could be seen as single-user.target. - runlevel1.target is an alias for this target unit, for - compatibility with SysV. - Use the systemd.unit=rescue.target kernel command line option to boot into this mode. A short alias for this kernel command line option is 1, for compatibility with SysV. - - runlevel2.target - runlevel3.target - runlevel4.target - runlevel5.target - - These are targets that are called whenever the SysV - compatibility code asks for runlevel 2, 3, 4, 5, - respectively. It is a good idea to make this an alias for - (i.e. symlink to) graphical.target - (for runlevel 5) or multi-user.target - (the others). - - shutdown.target diff --git a/man/systemd.target.xml b/man/systemd.target.xml index 19dabe4497a..3f83204b2da 100644 --- a/man/systemd.target.xml +++ b/man/systemd.target.xml @@ -45,10 +45,7 @@ for examples and descriptions of standard systemd targets. Target units provide a more flexible replacement for SysV runlevels in the classic SysV init - system. For compatibility reasons special target units such as runlevel3.target - exist which are used by the SysV runlevel compatibility code in systemd, see - systemd.special7 for - details. + system. Note that a target unit file must not be empty, lest it be considered a masked unit. It is recommended to provide a [Unit] section which includes informative Description= and diff --git a/tools/command_ignorelist b/tools/command_ignorelist index 72544ae0ddf..aed479938f6 100644 --- a/tools/command_ignorelist +++ b/tools/command_ignorelist @@ -326,7 +326,6 @@ systemd.special.xml ./refsect1[title="Units managed by the system service manage systemd.special.xml ./refsect1[title="Units managed by the system service manager"]/refsect2[title="Special Passive System Units "]/variablelist/varlistentry[term="remote-fs-pre.target"] systemd.special.xml ./refsect1[title="Units managed by the system service manager"]/refsect2[title="Special System Units"]/variablelist/varlistentry[term="rescue.target"] systemd.special.xml ./refsect1[title="Units managed by the system service manager"]/refsect2[title="Special Passive System Units "]/variablelist/varlistentry[term="rpcbind.target"] -systemd.special.xml ./refsect1[title="Units managed by the system service manager"]/refsect2[title="Special System Units"]/variablelist/varlistentry[term="runlevel2.target"] systemd.special.xml ./refsect1[title="Units managed by the system service manager"]/refsect2[title="Special System Units"]/variablelist/varlistentry[term="shutdown.target"] systemd.special.xml ./refsect1[title="Units managed by the system service manager"]/refsect2[title="Special System Units"]/variablelist/varlistentry[term="sigpwr.target"] systemd.special.xml ./refsect1[title="Units managed by the system service manager"]/refsect2[title="Special System Units"]/variablelist/varlistentry[term="sleep.target"] diff --git a/units/meson.build b/units/meson.build index 34b3222f114..4f47a3b2bde 100644 --- a/units/meson.build +++ b/units/meson.build @@ -1,7 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -with_runlevels = conf.get('HAVE_SYSV_COMPAT') == 1 - units = [ { 'file' : 'basic.target' }, { 'file' : 'blockdev@.target' }, @@ -51,7 +49,7 @@ units = [ }, { 'file' : 'graphical.target', - 'symlinks' : ['default.target'] + (with_runlevels ? ['runlevel5.target'] : []), + 'symlinks' : ['default.target'], }, { 'file' : 'halt.target' }, { @@ -144,20 +142,14 @@ units = [ 'conditions' : ['ENABLE_MACHINED'], }, { 'file' : 'modprobe@.service' }, - { - 'file' : 'multi-user.target', - 'symlinks' : with_runlevels ? ['runlevel2.target', 'runlevel3.target', 'runlevel4.target'] : [], - }, + { 'file' : 'multi-user.target' }, { 'file' : 'network-online.target' }, { 'file' : 'network-pre.target' }, { 'file' : 'network.target' }, { 'file' : 'nss-lookup.target' }, { 'file' : 'nss-user-lookup.target' }, { 'file' : 'paths.target' }, - { - 'file' : 'poweroff.target', - 'symlinks' : with_runlevels ? ['runlevel0.target'] : [], - }, + { 'file' : 'poweroff.target' }, { 'file' : 'printer.target' }, { 'file' : 'proc-sys-fs-binfmt_misc.automount', @@ -182,7 +174,7 @@ units = [ }, { 'file' : 'reboot.target', - 'symlinks' : ['ctrl-alt-del.target'] + (with_runlevels ? ['runlevel6.target'] : []), + 'symlinks' : ['ctrl-alt-del.target'], }, { 'file' : 'remote-cryptsetup.target', @@ -202,10 +194,7 @@ units = [ 'symlinks' : ['initrd-root-device.target.wants/'], }, { 'file' : 'rescue.service.in' }, - { - 'file' : 'rescue.target', - 'symlinks' : with_runlevels ? ['runlevel1.target'] : [], - }, + { 'file' : 'rescue.target' }, { 'file' : 'rpcbind.target' }, { 'file' : 'serial-getty@.service.in' }, { 'file' : 'shutdown.target' }, @@ -983,10 +972,4 @@ else dbussessionservicedir / 'org.freedesktop.systemd1.service')) endif -if conf.get('HAVE_SYSV_COMPAT') == 1 - foreach i : [1, 2, 3, 4, 5] - install_emptydir(systemunitdir / 'runlevel@0@.target.wants'.format(i)) - endforeach -endif - subdir('user')