systemctl: drop chain invocation of telinit

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
This commit is contained in:
Michael Biebl 2024-02-08 14:06:00 +01:00 committed by Luca Boccassi
parent e07e7017bb
commit 50b68cff54
6 changed files with 2 additions and 27 deletions

View file

@ -700,8 +700,6 @@ foreach prog : progs
conf.set_quoted(name, path) conf.set_quoted(name, path)
endforeach endforeach
conf.set_quoted('TELINIT', get_option('telinit-path'))
if run_command(ln, '--relative', '--help', check : false).returncode() != 0 if run_command(ln, '--relative', '--help', check : false).returncode() != 0
error('ln does not support --relative (added in coreutils 8.16)') error('ln does not support --relative (added in coreutils 8.16)')
endif endif

View file

@ -47,8 +47,6 @@ option('sysvinit-path', type : 'string', value : '/etc/init.d',
description : 'the directory where the SysV init scripts are located') description : 'the directory where the SysV init scripts are located')
option('sysvrcnd-path', type : 'string', value : '/etc/rc.d', option('sysvrcnd-path', type : 'string', value : '/etc/rc.d',
description : 'the base directory for SysV rcN.d directories') 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', option('rc-local', type : 'string',
value : '/etc/rc.local') value : '/etc/rc.local')
option('initrd', type : 'boolean', option('initrd', type : 'boolean',

View file

@ -155,11 +155,3 @@ int reload_with_fallback(void) {
return 0; 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.");
}

View file

@ -4,4 +4,3 @@
int telinit_parse_argv(int argc, char *argv[]); int telinit_parse_argv(int argc, char *argv[]);
int start_with_fallback(void); int start_with_fallback(void);
int reload_with_fallback(void); int reload_with_fallback(void);
int exec_telinit(char *argv[]);

View file

@ -1118,15 +1118,8 @@ int systemctl_dispatch_parse_argv(int argc, char *argv[]) {
* *
* Also see redirect_telinit() in src/core/main.c. */ * Also see redirect_telinit() in src/core/main.c. */
if (sd_booted() > 0) { arg_action = _ACTION_INVALID; /* telinit_parse_argv() will figure out the actual action we'll execute */
arg_action = _ACTION_INVALID; return telinit_parse_argv(argc, argv);
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;
}
} else if (invoked_as(argv, "runlevel")) { } else if (invoked_as(argv, "runlevel")) {
arg_action = ACTION_RUNLEVEL; arg_action = ACTION_RUNLEVEL;
@ -1330,10 +1323,6 @@ static int run(int argc, char *argv[]) {
r = runlevel_main(); r = runlevel_main();
break; break;
case ACTION_TELINIT:
r = exec_telinit(argv);
break;
case ACTION_EXIT: case ACTION_EXIT:
case ACTION_SLEEP: case ACTION_SLEEP:
case ACTION_SUSPEND: case ACTION_SUSPEND:

View file

@ -33,7 +33,6 @@ enum action {
ACTION_RELOAD, ACTION_RELOAD,
ACTION_REEXEC, ACTION_REEXEC,
ACTION_RUNLEVEL, ACTION_RUNLEVEL,
ACTION_TELINIT,
ACTION_CANCEL_SHUTDOWN, ACTION_CANCEL_SHUTDOWN,
ACTION_SHOW_SHUTDOWN, ACTION_SHOW_SHUTDOWN,
_ACTION_MAX, _ACTION_MAX,