]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: drop chain invocation of telinit
authorMichael Biebl <biebl@debian.org>
Thu, 8 Feb 2024 13:06:00 +0000 (14:06 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 15 Feb 2024 14:29:20 +0000 (14:29 +0000)
This functionality relied on telinit being available in a different path
then the compat symlink shipped by systemd itself. This is no longer the
case for any known distro, so remove that code.

Fixes: #31220
Replaces: #31249

meson.build
meson_options.txt
src/systemctl/systemctl-compat-telinit.c
src/systemctl/systemctl-compat-telinit.h
src/systemctl/systemctl.c
src/systemctl/systemctl.h

index ff79efd989cb07f633c02c912928e055877818b2..b4a5ada1c8ad538e43cc2bd36cb674293dfcb070 100644 (file)
@@ -700,8 +700,6 @@ foreach prog : progs
         conf.set_quoted(name, path)
 endforeach
 
-conf.set_quoted('TELINIT', get_option('telinit-path'))
-
 if run_command(ln, '--relative', '--help', check : false).returncode() != 0
         error('ln does not support --relative (added in coreutils 8.16)')
 endif
index 9a6abd4981a3751bf4cdff05a416da170aa39e5b..b51af01721d419633afce4ed4e1a59bca508b3cf 100644 (file)
@@ -47,8 +47,6 @@ option('sysvinit-path', type : 'string', value : '/etc/init.d',
        description : 'the directory where the SysV init scripts are located')
 option('sysvrcnd-path', type : 'string', value : '/etc/rc.d',
        description : 'the base directory for SysV rcN.d directories')
-option('telinit-path', type : 'string', value : '/lib/sysvinit/telinit',
-       description : 'path to telinit')
 option('rc-local', type : 'string',
        value : '/etc/rc.local')
 option('initrd', type : 'boolean',
index 20325e5e1c6d8bd93c88f4b84979c760e221f00a..210d0a1d4684b3474b28656dbea234b7ffbf037c 100644 (file)
@@ -155,11 +155,3 @@ int reload_with_fallback(void) {
 
         return 0;
 }
-
-int exec_telinit(char *argv[]) {
-        (void) rlimit_nofile_safe();
-        (void) execv(TELINIT, argv);
-
-        return log_error_errno(SYNTHETIC_ERRNO(EIO),
-                               "Couldn't find an alternative telinit implementation to spawn.");
-}
index 783c3878a0e1148b12e461fa8f59d2b52313bcee..1a2bcd440523b8068a12eae8f7302efad47b37ec 100644 (file)
@@ -4,4 +4,3 @@
 int telinit_parse_argv(int argc, char *argv[]);
 int start_with_fallback(void);
 int reload_with_fallback(void);
-int exec_telinit(char *argv[]);
index d278d74789de3b8e252b1a601014a39ab9a0bec8..1ac7edbdd2586684c19da42a5da915d276b691d5 100644 (file)
@@ -1118,15 +1118,8 @@ int systemctl_dispatch_parse_argv(int argc, char *argv[]) {
                  *
                  * Also see redirect_telinit() in src/core/main.c. */
 
-                if (sd_booted() > 0) {
-                        arg_action = _ACTION_INVALID;
-                        return telinit_parse_argv(argc, argv);
-                } else {
-                        /* Hmm, so some other init system is running, we need to forward this request to it.
-                         */
-                        arg_action = ACTION_TELINIT;
-                        return 1;
-                }
+                arg_action = _ACTION_INVALID; /* telinit_parse_argv() will figure out the actual action we'll execute */
+                return telinit_parse_argv(argc, argv);
 
         } else if (invoked_as(argv, "runlevel")) {
                 arg_action = ACTION_RUNLEVEL;
@@ -1330,10 +1323,6 @@ static int run(int argc, char *argv[]) {
                 r = runlevel_main();
                 break;
 
-        case ACTION_TELINIT:
-                r = exec_telinit(argv);
-                break;
-
         case ACTION_EXIT:
         case ACTION_SLEEP:
         case ACTION_SUSPEND:
index 17dcfb404857618e5701b3d4031f8a0fc016c77a..cc2b8c2cc4600dc79a0919df2c3bfdd792b37cdb 100644 (file)
@@ -33,7 +33,6 @@ enum action {
         ACTION_RELOAD,
         ACTION_REEXEC,
         ACTION_RUNLEVEL,
-        ACTION_TELINIT,
         ACTION_CANCEL_SHUTDOWN,
         ACTION_SHOW_SHUTDOWN,
         _ACTION_MAX,