" <property name=\"ControlGroupHierarchy\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"MountAuto\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"SwapAuto\" type=\"b\" access=\"read\"/>\n" \
- " <property name=\"DefaultControllers\" type=\"as\" access=\"read\"/>\n"
- \
+ " <property name=\"DefaultControllers\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"DefaultStandardOutput\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"DefaultStandardError\" type=\"s\" access=\"read\"/>\n"
#ifdef HAVE_SYSV_COMPAT
#define BUS_MANAGER_INTERFACE_PROPERTIES_SYSV \
const char bus_manager_interface[] _introspect_("Manager") = BUS_MANAGER_INTERFACE;
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_manager_append_running_as, manager_running_as, ManagerRunningAs);
+static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_manager_append_exec_output, exec_output, ExecOutput);
static int bus_manager_append_log_target(Manager *m, DBusMessageIter *i, const char *property, void *data) {
const char *t;
{ "org.freedesktop.systemd1.Manager", "MountAuto", bus_property_append_bool, "b", &m->mount_auto },
{ "org.freedesktop.systemd1.Manager", "SwapAuto", bus_property_append_bool, "b", &m->swap_auto },
{ "org.freedesktop.systemd1.Manager", "DefaultControllers", bus_property_append_strv, "as", m->default_controllers },
+ { "org.freedesktop.systemd1.Manager", "DefaultStandardOutput", bus_manager_append_exec_output, "s", &m->default_std_output },
+ { "org.freedesktop.systemd1.Manager", "DefaultStandardError", bus_manager_append_exec_output, "s", &m->default_std_error },
#ifdef HAVE_SYSV_COMPAT
{ "org.freedesktop.systemd1.Manager", "SysVConsole", bus_property_append_bool, "b", &m->sysv_console },
{ "org.freedesktop.systemd1.Manager", "SysVInitPath", bus_property_append_strv, "as", m->lookup_paths.sysvinit_path },
static bool arg_mount_auto = true;
static bool arg_swap_auto = true;
static char **arg_default_controllers = NULL;
+static ExecOutput arg_default_std_output = EXEC_OUTPUT_NULL;
+static ExecOutput arg_default_std_error = EXEC_OUTPUT_INHERIT;
static FILE* serialization = NULL;
log_warning("Failed to parse show status switch %s, Ignoring.", word + 20);
else
arg_show_status = r;
+ } else if (startswith(word, "systemd.default_standard_output=")) {
+ int r;
+
+ if ((r = exec_output_from_string(word + 32)) < 0)
+ log_warning("Failed to parse default standard output switch %s, Ignoring.", word + 32);
+ else
+ arg_default_std_output = r;
+ } else if (startswith(word, "systemd.default_standard_error=")) {
+ int r;
+
+ if ((r = exec_output_from_string(word + 31)) < 0)
+ log_warning("Failed to parse default standard error switch %s, Ignoring.", word + 31);
+ else
+ arg_default_std_error = r;
#ifdef HAVE_SYSV_COMPAT
} else if (startswith(word, "systemd.sysv_console=")) {
int r;
" Log target\n"
"systemd.log_level=LEVEL Log level\n"
"systemd.log_color=0|1 Highlight important log messages\n"
- "systemd.log_location=0|1 Include code location in log messages\n");
+ "systemd.log_location=0|1 Include code location in log messages\n"
+ "systemd.default_standard_output=null|tty|syslog|syslog+console|kmsg|kmsg+console\n"
+ " Set default log output for services\n"
+ "systemd.default_standard_error=null|tty|syslog|syslog+console|kmsg|kmsg+console\n"
+ " Set default log error output for services\n");
} else if (streq(word, "quiet")) {
arg_show_status = false;
return 0;
}
+static DEFINE_CONFIG_PARSE_ENUM(config_parse_output, exec_output, ExecOutput, "Failed to parse output specifier");
+
static int parse_config_file(void) {
const ConfigItem items[] = {
- { "LogLevel", config_parse_level, NULL, "Manager" },
- { "LogTarget", config_parse_target, NULL, "Manager" },
- { "LogColor", config_parse_color, NULL, "Manager" },
- { "LogLocation", config_parse_location, NULL, "Manager" },
- { "DumpCore", config_parse_bool, &arg_dump_core, "Manager" },
- { "CrashShell", config_parse_bool, &arg_crash_shell, "Manager" },
- { "ShowStatus", config_parse_bool, &arg_show_status, "Manager" },
+ { "LogLevel", config_parse_level, NULL, "Manager" },
+ { "LogTarget", config_parse_target, NULL, "Manager" },
+ { "LogColor", config_parse_color, NULL, "Manager" },
+ { "LogLocation", config_parse_location, NULL, "Manager" },
+ { "DumpCore", config_parse_bool, &arg_dump_core, "Manager" },
+ { "CrashShell", config_parse_bool, &arg_crash_shell, "Manager" },
+ { "ShowStatus", config_parse_bool, &arg_show_status, "Manager" },
#ifdef HAVE_SYSV_COMPAT
- { "SysVConsole", config_parse_bool, &arg_sysv_console, "Manager" },
+ { "SysVConsole", config_parse_bool, &arg_sysv_console, "Manager" },
#endif
- { "CrashChVT", config_parse_int, &arg_crash_chvt, "Manager" },
- { "CPUAffinity", config_parse_cpu_affinity, NULL, "Manager" },
- { "MountAuto", config_parse_bool, &arg_mount_auto, "Manager" },
- { "SwapAuto", config_parse_bool, &arg_swap_auto, "Manager" },
- { "DefaultControllers", config_parse_strv, &arg_default_controllers, "Manager" },
+ { "CrashChVT", config_parse_int, &arg_crash_chvt, "Manager" },
+ { "CPUAffinity", config_parse_cpu_affinity, NULL, "Manager" },
+ { "MountAuto", config_parse_bool, &arg_mount_auto, "Manager" },
+ { "SwapAuto", config_parse_bool, &arg_swap_auto, "Manager" },
+ { "DefaultControllers", config_parse_strv, &arg_default_controllers, "Manager" },
+ { "DefaultStandardOutput", config_parse_output, &arg_default_std_output, "Manager" },
+ { "DefaultStandardError", config_parse_output, &arg_default_std_error, "Manager" },
{ NULL, NULL, NULL, NULL }
};
ARG_SHOW_STATUS,
ARG_SYSV_CONSOLE,
ARG_DESERIALIZE,
- ARG_INTROSPECT
+ ARG_INTROSPECT,
+ ARG_DEFAULT_STD_OUTPUT,
+ ARG_DEFAULT_STD_ERROR
};
static const struct option options[] = {
#endif
{ "deserialize", required_argument, NULL, ARG_DESERIALIZE },
{ "introspect", optional_argument, NULL, ARG_INTROSPECT },
+ { "default-standard-output", required_argument, NULL, ARG_DEFAULT_STD_OUTPUT, },
+ { "default-standard-error", required_argument, NULL, ARG_DEFAULT_STD_ERROR, },
{ NULL, 0, NULL, 0 }
};
break;
+ case ARG_DEFAULT_STD_OUTPUT:
+
+ if ((r = exec_output_from_string(optarg)) < 0) {
+ log_error("Failed to parse default standard output setting %s.", optarg);
+ return r;
+ } else
+ arg_default_std_output = r;
+ break;
+
+ case ARG_DEFAULT_STD_ERROR:
+
+ if ((r = exec_output_from_string(optarg)) < 0) {
+ log_error("Failed to parse default standard error output setting %s.", optarg);
+ return r;
+ } else
+ arg_default_std_error = r;
+ break;
+
case ARG_UNIT:
if ((r = set_default_unit(optarg)) < 0) {
" --log-target=TARGET Set log target (console, syslog, kmsg, syslog-or-kmsg, null)\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-location[=0|1] Include code location in log messages\n",
+ " --log-location[=0|1] Include code location in log messages\n"
+ " --default-standard-output= Set default standard output for services\n"
+ " --default-standard-error= Set default standard error output for services\n",
program_invocation_short_name);
return 0;
#endif
m->mount_auto = arg_mount_auto;
m->swap_auto = arg_swap_auto;
+ m->default_std_output = arg_default_std_output;
+ m->default_std_error = arg_default_std_error;
if (dual_timestamp_is_set(&initrd_timestamp))
m->initrd_timestamp = initrd_timestamp;