core: remove sysv_console option

This option never made much sense. It was originally intended to make
sure that the usual startup output of sysv scripts goes to the terminal.
However, since SysV scripts started from a terminal would not output to
that terminal, but rather /dev/console this effect was more often than
not actually taking place. Nowadays systemd has much nicer boot time
status output than SysV which makes the sysv output redundant. Finally,
all output of services goes to the journal anyway, and is not lost.

Hence, let's drop this option, and simplify things a bit.
This commit is contained in:
Lennart Poettering 2012-06-22 13:16:28 +02:00
parent b0193f1c1f
commit d081dffbd3
8 changed files with 3 additions and 87 deletions

View file

@ -80,7 +80,6 @@
<term><varname>systemd.crash_chvt=</varname></term> <term><varname>systemd.crash_chvt=</varname></term>
<term><varname>systemd.confirm_spawn=</varname></term> <term><varname>systemd.confirm_spawn=</varname></term>
<term><varname>systemd.show_status=</varname></term> <term><varname>systemd.show_status=</varname></term>
<term><varname>systemd.sysv_console=</varname></term>
<term><varname>systemd.log_target=</varname></term> <term><varname>systemd.log_target=</varname></term>
<term><varname>systemd.log_level=</varname></term> <term><varname>systemd.log_level=</varname></term>
<term><varname>systemd.log_color=</varname></term> <term><varname>systemd.log_color=</varname></term>

View file

@ -79,7 +79,6 @@
<term><varname>DumpCore=yes</varname></term> <term><varname>DumpCore=yes</varname></term>
<term><varname>CrashShell=no</varname></term> <term><varname>CrashShell=no</varname></term>
<term><varname>ShowStatus=yes</varname></term> <term><varname>ShowStatus=yes</varname></term>
<term><varname>SysVConsole=yes</varname></term>
<term><varname>CrashChVT=1</varname></term> <term><varname>CrashChVT=1</varname></term>
<term><varname>DefaultStandardOutput=journal</varname></term> <term><varname>DefaultStandardOutput=journal</varname></term>
<term><varname>DefaultStandardError=inherit</varname></term> <term><varname>DefaultStandardError=inherit</varname></term>

View file

@ -191,18 +191,6 @@
interpreted as interpreted as
<option>true</option>.</para></listitem> <option>true</option>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>--sysv-console=</option></term>
<listitem><para>Controls whether
output of SysV init scripts will be
directed to the console. This switch
has no effect when run as user
instance. Takes a boolean argument
which may be omitted which is
interpreted as
<option>true</option>.</para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>--log-target=</option></term> <term><option>--log-target=</option></term>
@ -1048,20 +1036,6 @@
<option>false</option>.</para></listitem> <option>false</option>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>systemd.sysv_console=</varname></term>
<listitem><para>Takes a boolean
argument. If <option>true</option>
output of SysV init scripts will be
directed to the console. Defaults to
<option>true</option>, unless
<option>quiet</option> is passed as
kernel command line option in which
case it defaults to
<option>false</option>.</para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>systemd.log_target=</varname></term> <term><varname>systemd.log_target=</varname></term>
<term><varname>systemd.log_level=</varname></term> <term><varname>systemd.log_level=</varname></term>
@ -1106,12 +1080,8 @@
<term><varname>quiet</varname></term> <term><varname>quiet</varname></term>
<listitem><para>If passed turns off <listitem><para>If passed turns off
status output at boot, and disconnects status output at boot, much like
SysV scripts from the console, much
like
<varname>systemd.show_status=false</varname> <varname>systemd.show_status=false</varname>
and
<varname>systemd.sysv_console=false</varname>
would. Note that this option is also would. Note that this option is also
read by the kernel itself and disables read by the kernel itself and disables
kernel log output to the kernel log output to the

View file

@ -252,7 +252,6 @@
#ifdef HAVE_SYSV_COMPAT #ifdef HAVE_SYSV_COMPAT
#define BUS_MANAGER_INTERFACE_PROPERTIES_SYSV \ #define BUS_MANAGER_INTERFACE_PROPERTIES_SYSV \
" <property name=\"SysVConsole\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"SysVInitPath\" type=\"as\" access=\"read\"/>\n" \ " <property name=\"SysVInitPath\" type=\"as\" access=\"read\"/>\n" \
" <property name=\"SysVRcndPath\" type=\"as\" access=\"read\"/>\n" " <property name=\"SysVRcndPath\" type=\"as\" access=\"read\"/>\n"
#else #else
@ -569,7 +568,6 @@ static const BusProperty bus_manager_properties[] = {
{ "ShutdownWatchdogUSec", bus_property_append_usec, "t", offsetof(Manager, shutdown_watchdog), false, bus_property_set_usec }, { "ShutdownWatchdogUSec", bus_property_append_usec, "t", offsetof(Manager, shutdown_watchdog), false, bus_property_set_usec },
{ "HaveWatchdog", bus_manager_append_have_watchdog, "b", 0 }, { "HaveWatchdog", bus_manager_append_have_watchdog, "b", 0 },
#ifdef HAVE_SYSV_COMPAT #ifdef HAVE_SYSV_COMPAT
{ "SysVConsole", bus_property_append_bool, "b", offsetof(Manager, sysv_console) },
{ "SysVInitPath", bus_property_append_strv, "as", offsetof(Manager, lookup_paths.sysvinit_path), true }, { "SysVInitPath", bus_property_append_strv, "as", offsetof(Manager, lookup_paths.sysvinit_path), true },
{ "SysVRcndPath", bus_property_append_strv, "as", offsetof(Manager, lookup_paths.sysvrcnd_path), true }, { "SysVRcndPath", bus_property_append_strv, "as", offsetof(Manager, lookup_paths.sysvrcnd_path), true },
#endif #endif

View file

@ -79,9 +79,6 @@ static int arg_crash_chvt = -1;
static bool arg_confirm_spawn = false; static bool arg_confirm_spawn = false;
static bool arg_show_status = true; static bool arg_show_status = true;
static bool arg_switched_root = false; static bool arg_switched_root = false;
#ifdef HAVE_SYSV_COMPAT
static bool arg_sysv_console = true;
#endif
static char **arg_default_controllers = NULL; static char **arg_default_controllers = NULL;
static char ***arg_join_controllers = NULL; static char ***arg_join_controllers = NULL;
static ExecOutput arg_default_std_output = EXEC_OUTPUT_JOURNAL; static ExecOutput arg_default_std_output = EXEC_OUTPUT_JOURNAL;
@ -364,15 +361,6 @@ static int parse_proc_cmdline_word(const char *word) {
log_warning("setenv failed %s. Ignoring.", strerror(errno)); log_warning("setenv failed %s. Ignoring.", strerror(errno));
} }
free(cenv); free(cenv);
#ifdef HAVE_SYSV_COMPAT
} else if (startswith(word, "systemd.sysv_console=")) {
int r;
if ((r = parse_boolean(word + 21)) < 0)
log_warning("Failed to parse SysV console switch %s. Ignoring.", word + 20);
else
arg_sysv_console = r;
#endif
} else if (startswith(word, "systemd.") || } else if (startswith(word, "systemd.") ||
(in_initrd() && startswith(word, "rd.systemd."))) { (in_initrd() && startswith(word, "rd.systemd."))) {
@ -387,9 +375,6 @@ static int parse_proc_cmdline_word(const char *word) {
"systemd.crash_chvt=N Change to VT #N on crash\n" "systemd.crash_chvt=N Change to VT #N on crash\n"
"systemd.confirm_spawn=0|1 Confirm every process spawn\n" "systemd.confirm_spawn=0|1 Confirm every process spawn\n"
"systemd.show_status=0|1 Show status updates on the console during bootup\n" "systemd.show_status=0|1 Show status updates on the console during bootup\n"
#ifdef HAVE_SYSV_COMPAT
"systemd.sysv_console=0|1 Connect output of SysV scripts to console\n"
#endif
"systemd.log_target=console|kmsg|journal|journal-or-kmsg|syslog|syslog-or-kmsg|null\n" "systemd.log_target=console|kmsg|journal|journal-or-kmsg|syslog|syslog-or-kmsg|null\n"
" Log target\n" " Log target\n"
"systemd.log_level=LEVEL Log level\n" "systemd.log_level=LEVEL Log level\n"
@ -401,12 +386,9 @@ static int parse_proc_cmdline_word(const char *word) {
" Set default log error output for services\n" " Set default log error output for services\n"
"systemd.setenv=ASSIGNMENT Set an environment variable for all spawned processes\n"); "systemd.setenv=ASSIGNMENT Set an environment variable for all spawned processes\n");
} else if (streq(word, "quiet")) { } else if (streq(word, "quiet"))
arg_show_status = false; arg_show_status = false;
#ifdef HAVE_SYSV_COMPAT else if (!in_initrd()) {
arg_sysv_console = false;
#endif
} else if (!in_initrd()) {
unsigned i; unsigned i;
/* SysV compatibility */ /* SysV compatibility */
@ -672,9 +654,6 @@ static int parse_config_file(void) {
{ "Manager", "DumpCore", config_parse_bool, 0, &arg_dump_core }, { "Manager", "DumpCore", config_parse_bool, 0, &arg_dump_core },
{ "Manager", "CrashShell", config_parse_bool, 0, &arg_crash_shell }, { "Manager", "CrashShell", config_parse_bool, 0, &arg_crash_shell },
{ "Manager", "ShowStatus", config_parse_bool, 0, &arg_show_status }, { "Manager", "ShowStatus", config_parse_bool, 0, &arg_show_status },
#ifdef HAVE_SYSV_COMPAT
{ "Manager", "SysVConsole", config_parse_bool, 0, &arg_sysv_console },
#endif
{ "Manager", "CrashChVT", config_parse_int, 0, &arg_crash_chvt }, { "Manager", "CrashChVT", config_parse_int, 0, &arg_crash_chvt },
{ "Manager", "CPUAffinity", config_parse_cpu_affinity2, 0, NULL }, { "Manager", "CPUAffinity", config_parse_cpu_affinity2, 0, NULL },
{ "Manager", "DefaultControllers", config_parse_strv, 0, &arg_default_controllers }, { "Manager", "DefaultControllers", config_parse_strv, 0, &arg_default_controllers },
@ -780,7 +759,6 @@ static int parse_argv(int argc, char *argv[]) {
ARG_CRASH_SHELL, ARG_CRASH_SHELL,
ARG_CONFIRM_SPAWN, ARG_CONFIRM_SPAWN,
ARG_SHOW_STATUS, ARG_SHOW_STATUS,
ARG_SYSV_CONSOLE,
ARG_DESERIALIZE, ARG_DESERIALIZE,
ARG_SWITCHED_ROOT, ARG_SWITCHED_ROOT,
ARG_INTROSPECT, ARG_INTROSPECT,
@ -803,9 +781,6 @@ static int parse_argv(int argc, char *argv[]) {
{ "crash-shell", optional_argument, NULL, ARG_CRASH_SHELL }, { "crash-shell", optional_argument, NULL, ARG_CRASH_SHELL },
{ "confirm-spawn", optional_argument, NULL, ARG_CONFIRM_SPAWN }, { "confirm-spawn", optional_argument, NULL, ARG_CONFIRM_SPAWN },
{ "show-status", optional_argument, NULL, ARG_SHOW_STATUS }, { "show-status", optional_argument, NULL, ARG_SHOW_STATUS },
#ifdef HAVE_SYSV_COMPAT
{ "sysv-console", optional_argument, NULL, ARG_SYSV_CONSOLE },
#endif
{ "deserialize", required_argument, NULL, ARG_DESERIALIZE }, { "deserialize", required_argument, NULL, ARG_DESERIALIZE },
{ "switched-root", no_argument, NULL, ARG_SWITCHED_ROOT }, { "switched-root", no_argument, NULL, ARG_SWITCHED_ROOT },
{ "introspect", optional_argument, NULL, ARG_INTROSPECT }, { "introspect", optional_argument, NULL, ARG_INTROSPECT },
@ -946,17 +921,6 @@ static int parse_argv(int argc, char *argv[]) {
arg_show_status = r; arg_show_status = r;
break; break;
#ifdef HAVE_SYSV_COMPAT
case ARG_SYSV_CONSOLE:
r = optarg ? parse_boolean(optarg) : 1;
if (r < 0) {
log_error("Failed to parse SysV console boolean %s.", optarg);
return r;
}
arg_sysv_console = r;
break;
#endif
case ARG_DESERIALIZE: { case ARG_DESERIALIZE: {
int fd; int fd;
FILE *f; FILE *f;
@ -1072,9 +1036,6 @@ static int help(void) {
" --crash-shell[=0|1] Run shell on crash\n" " --crash-shell[=0|1] Run shell on crash\n"
" --confirm-spawn[=0|1] Ask for confirmation when spawning processes\n" " --confirm-spawn[=0|1] Ask for confirmation when spawning processes\n"
" --show-status[=0|1] Show status updates on the console during bootup\n" " --show-status[=0|1] Show status updates on the console during bootup\n"
#ifdef HAVE_SYSV_COMPAT
" --sysv-console[=0|1] Connect output of SysV scripts to console\n"
#endif
" --log-target=TARGET Set log target (console, journal, syslog, kmsg, journal-or-kmsg, syslog-or-kmsg, null)\n" " --log-target=TARGET Set log target (console, journal, syslog, kmsg, journal-or-kmsg, syslog-or-kmsg, null)\n"
" --log-level=LEVEL Set log level (debug, info, notice, warning, err, crit, alert, emerg)\n" " --log-level=LEVEL Set log level (debug, info, notice, warning, err, crit, alert, emerg)\n"
" --log-color[=0|1] Highlight important log messages\n" " --log-color[=0|1] Highlight important log messages\n"
@ -1515,9 +1476,6 @@ int main(int argc, char *argv[]) {
} }
m->confirm_spawn = arg_confirm_spawn; m->confirm_spawn = arg_confirm_spawn;
#ifdef HAVE_SYSV_COMPAT
m->sysv_console = arg_sysv_console;
#endif
m->default_std_output = arg_default_std_output; m->default_std_output = arg_default_std_output;
m->default_std_error = arg_default_std_error; m->default_std_error = arg_default_std_error;
m->runtime_watchdog = arg_runtime_watchdog; m->runtime_watchdog = arg_runtime_watchdog;

View file

@ -222,9 +222,6 @@ struct Manager {
bool show_status; bool show_status;
bool confirm_spawn; bool confirm_spawn;
#ifdef HAVE_SYSV_COMPAT
bool sysv_console;
#endif
ExecOutput default_std_output, default_std_error; ExecOutput default_std_output, default_std_error;

View file

@ -928,10 +928,6 @@ static int service_load_sysv_path(Service *s, const char *path) {
s->guess_main_pid = false; s->guess_main_pid = false;
s->restart = SERVICE_RESTART_NO; s->restart = SERVICE_RESTART_NO;
s->exec_context.ignore_sigpipe = false; s->exec_context.ignore_sigpipe = false;
if (UNIT(s)->manager->sysv_console)
s->exec_context.std_output = EXEC_OUTPUT_JOURNAL_AND_CONSOLE;
s->exec_context.kill_mode = KILL_PROCESS; s->exec_context.kill_mode = KILL_PROCESS;
/* We use the long description only if /* We use the long description only if

View file

@ -15,7 +15,6 @@
#DumpCore=yes #DumpCore=yes
#CrashShell=no #CrashShell=no
#ShowStatus=yes #ShowStatus=yes
#SysVConsole=yes
#CrashChVT=1 #CrashChVT=1
#CPUAffinity=1 2 #CPUAffinity=1 2
#DefaultControllers=cpu #DefaultControllers=cpu