mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
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:
parent
e07e7017bb
commit
50b68cff54
@ -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
|
||||
|
@ -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',
|
||||
|
@ -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.");
|
||||
}
|
||||
|
@ -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[]);
|
||||
|
@ -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:
|
||||
|
@ -33,7 +33,6 @@ enum action {
|
||||
ACTION_RELOAD,
|
||||
ACTION_REEXEC,
|
||||
ACTION_RUNLEVEL,
|
||||
ACTION_TELINIT,
|
||||
ACTION_CANCEL_SHUTDOWN,
|
||||
ACTION_SHOW_SHUTDOWN,
|
||||
_ACTION_MAX,
|
||||
|
Loading…
Reference in New Issue
Block a user