From: Lennart Poettering Date: Sun, 4 Jul 2010 23:08:13 +0000 (+0200) Subject: turn negative options into positive options X-Git-Tag: v1~32 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=74922904348e53a992af63c581d4ccd3317ccce0 turn negative options into positive options --- diff --git a/fixme b/fixme index 2f133d43a..1e27844ca 100644 --- a/fixme +++ b/fixme @@ -39,8 +39,6 @@ * systemctl daemon-reload is kaputt -* Turn around negative options - * Add missing man pages: update systemd.1, finish daemon.7 External: diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index 83eef32f5..6502d87b4 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -468,7 +468,7 @@ the default log level specified here. The interpretation of these prefixes may be disabled with - SyslogNoPrefix=, + SyslogLevelPrefix=, see below. For details see sd-daemon7. @@ -477,9 +477,9 @@ - SyslogNoPrefix= + SyslogLevelPrefix= Takes a boolean - argument. If false and + argument. If true and StandardOutput= or StandardError= are set to or @@ -488,12 +488,12 @@ are prefixed with a log level will be passed on to syslog with this log level set but the prefix removed. If - set to true, the interpretation of + set to false, the interpretation of these prefixes is disabled and the logged lines are passed on as-is. For details about this prefixing see sd-daemon7. - Defaults to false. + Defaults to true. diff --git a/src/dbus-execute.h b/src/dbus-execute.h index 520815969..32d58d646 100644 --- a/src/dbus-execute.h +++ b/src/dbus-execute.h @@ -69,7 +69,7 @@ " \n" \ " \n" \ " \n" \ - " \n" \ + " \n" \ " \n" \ " \n" \ " \n" \ @@ -83,7 +83,7 @@ " \n" \ " \n" \ " \n" \ - " \n" + " \n" #define BUS_EXEC_COMMAND_INTERFACE(name) \ " \n" @@ -115,7 +115,7 @@ { interface, "CPUSchedulingPolicy", bus_execute_append_cpu_sched_policy, "i", &(context) }, \ { interface, "CPUSchedulingPriority", bus_execute_append_cpu_sched_priority, "i", &(context) }, \ { interface, "CPUAffinity", bus_execute_append_affinity,"ay", &(context) }, \ - { interface, "TimerSlackNSec", bus_execute_append_timer_slack_nsec, "t", &(context) }, \ + { interface, "TimerSlackNSec", bus_execute_append_timer_slack_nsec, "t", &(context) }, \ { interface, "CPUSchedulingResetOnFork", bus_property_append_bool, "b", &(context).cpu_sched_reset_on_fork }, \ { interface, "NonBlocking", bus_property_append_bool, "b", &(context).non_blocking }, \ { interface, "StandardInput", bus_execute_append_input, "s", &(context).std_input }, \ @@ -124,7 +124,7 @@ { interface, "TTYPath", bus_property_append_string, "s", (context).tty_path }, \ { interface, "SyslogPriority", bus_property_append_int, "i", &(context).syslog_priority }, \ { interface, "SyslogIdentifier", bus_property_append_string, "s", (context).syslog_identifier }, \ - { interface, "SyslogNoPrefix", bus_property_append_bool, "b", &(context).syslog_no_prefix }, \ + { interface, "SyslogLevelPrefix", bus_property_append_bool, "b", &(context).syslog_level_prefix }, \ { interface, "Capabilities", bus_property_append_string, "s", (context).capabilities }, \ { interface, "SecureBits", bus_property_append_int, "i", &(context).secure_bits }, \ { interface, "CapabilityBoundingSetDrop", bus_property_append_uint64, "t", &(context).capability_bounding_set_drop }, \ @@ -138,7 +138,7 @@ { interface, "InaccessibleDirectories", bus_property_append_strv, "as", (context).inaccessible_dirs }, \ { interface, "MountFlags", bus_property_append_ul, "t", &(context).mount_flags }, \ { interface, "PrivateTmp", bus_property_append_bool, "b", &(context).private_tmp }, \ - { interface, "NoSetSID", bus_property_append_bool, "b", &(context).no_setsid } + { interface, "SameProcessGroup", bus_property_append_bool, "b", &(context).same_pgrp } #define BUS_EXEC_STATUS_PROPERTIES(interface, estatus, prefix) \ { interface, prefix "StartTimestamp", bus_property_append_usec, "t", &(estatus).start_timestamp.realtime }, \ @@ -147,7 +147,7 @@ { interface, prefix "Code", bus_property_append_int, "i", &(estatus).code }, \ { interface, prefix "Status", bus_property_append_int, "i", &(estatus).status } -#define BUS_EXEC_COMMAND_PROPERTY(interface, command, name) \ +#define BUS_EXEC_COMMAND_PROPERTY(interface, command, name) \ { interface, name, bus_execute_append_command, "a(sasttuii)", (command) } int bus_execute_append_output(Manager *m, DBusMessageIter *i, const char *property, void *data); diff --git a/src/execute.c b/src/execute.c index 982b7d1bc..2acb11192 100644 --- a/src/execute.c +++ b/src/execute.c @@ -197,7 +197,7 @@ static int connect_logger_as(const ExecContext *context, ExecOutput output, cons output == EXEC_OUTPUT_KMSG ? "kmsg" : "syslog", context->syslog_priority, context->syslog_identifier ? context->syslog_identifier : ident, - !context->syslog_no_prefix); + context->syslog_level_prefix); if (fd != nfd) { r = dup2(fd, nfd) < 0 ? -errno : nfd; @@ -964,7 +964,7 @@ int exec_spawn(ExecCommand *command, goto fail; } - if (!context->no_setsid) + if (!context->same_pgrp) if (setsid() < 0) { r = EXIT_SETSID; goto fail; @@ -1294,6 +1294,7 @@ void exec_context_init(ExecContext *c) { c->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0); c->cpu_sched_policy = SCHED_OTHER; c->syslog_priority = LOG_DAEMON|LOG_INFO; + c->syslog_level_prefix = true; c->mount_flags = MS_SHARED; } diff --git a/src/execute.h b/src/execute.h index 1ab6a24d9..2e0e6cca3 100644 --- a/src/execute.h +++ b/src/execute.h @@ -103,7 +103,7 @@ struct ExecContext { int syslog_priority; char *syslog_identifier; - bool syslog_no_prefix; + bool syslog_level_prefix; char *tcpwrap_name; @@ -142,7 +142,7 @@ struct ExecContext { * /bin/mount it is run in the same process group as us so * that the autofs logic detects that it belongs to us and we * don't enter a trigger loop. */ - bool no_setsid; + bool same_pgrp; }; typedef enum ExitStatus { diff --git a/src/load-fragment.c b/src/load-fragment.c index 8e777fdbc..3c0cccff4 100644 --- a/src/load-fragment.c +++ b/src/load-fragment.c @@ -1464,7 +1464,7 @@ static int load_from_path(Unit *u, const char *path) { { "SyslogIdentifier", config_parse_string_printf, &(context).syslog_identifier, section }, \ { "SyslogFacility", config_parse_facility, &(context).syslog_priority, section }, \ { "SyslogLevel", config_parse_level, &(context).syslog_priority, section }, \ - { "SyslogNoPrefix", config_parse_bool, &(context).syslog_no_prefix, section }, \ + { "SyslogLevelPrefix", config_parse_bool, &(context).syslog_level_prefix, section }, \ { "Capabilities", config_parse_capabilities, &(context), section }, \ { "SecureBits", config_parse_secure_bits, &(context), section }, \ { "CapabilityBoundingSetDrop", config_parse_bounding_set, &(context), section }, \ diff --git a/src/mount.c b/src/mount.c index b99e5ffe8..6da880eb8 100644 --- a/src/mount.c +++ b/src/mount.c @@ -68,7 +68,7 @@ static void mount_init(Unit *u) { * the same process group as us, so that the autofs kernel * side doesn't send us another mount request while we are * already trying to comply its last one. */ - m->exec_context.no_setsid = true; + m->exec_context.same_pgrp = true; m->timer_watch.type = WATCH_INVALID;