]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl/halt: drop support for calling in SysV init script
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 21 Apr 2025 04:14:30 +0000 (13:14 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Jul 2025 20:38:13 +0000 (05:38 +0900)
Traditionally, halt is called at the end of the init script on
reboot/shutdown. To support such usecase, previously we read the current
runlevel from utmp and set force flag on reboot/shutdown.

This drops the support for such the usecase.
Note, neither supported nor tested, but hopefully still the command can
be used in the end of the sysv init script by specifying -ff.

src/systemctl/systemctl-compat-halt.c

index 0b05fe6702c4513c597334f62e6f948239aca388..c360a8d00732a669f064f372b8c1d9fb66fc051e 100644 (file)
@@ -77,16 +77,11 @@ int halt_parse_argv(int argc, char *argv[]) {
                 {}
         };
 
-        int c, r, runlevel;
+        int c, r;
 
         assert(argc >= 0);
         assert(argv);
 
-        /* called in sysvinit system as last command in shutdown/reboot so this is always forceful */
-        if (utmp_get_runlevel(&runlevel, NULL) >= 0)
-                if (IN_SET(runlevel, '0', '6'))
-                        arg_force = 2;
-
         while ((c = getopt_long(argc, argv, "pfwdnih", options, NULL)) >= 0)
                 switch (c) {