turn negative options into positive options

This commit is contained in:
Lennart Poettering 2010-07-05 01:08:13 +02:00
parent a567261a29
commit 7492290434
7 changed files with 18 additions and 19 deletions

2
fixme
View File

@ -39,8 +39,6 @@
* systemctl daemon-reload is kaputt
* Turn around negative options
* Add missing man pages: update systemd.1, finish daemon.7
External:

View File

@ -468,7 +468,7 @@
the default log level specified
here. The interpretation of these
prefixes may be disabled with
<varname>SyslogNoPrefix=</varname>,
<varname>SyslogLevelPrefix=</varname>,
see below. For details see
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
@ -477,9 +477,9 @@
</varlistentry>
<varlistentry>
<term><varname>SyslogNoPrefix=</varname></term>
<term><varname>SyslogLevelPrefix=</varname></term>
<listitem><para>Takes a boolean
argument. If false and
argument. If true and
<varname>StandardOutput=</varname> or
<varname>StandardError=</varname> are
set to <option>syslog</option> 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
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
Defaults to false.</para></listitem>
Defaults to true.</para></listitem>
</varlistentry>
<varlistentry>

View File

@ -69,7 +69,7 @@
" <property name=\"TTYPath\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"SyslogNoPrefix\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"SyslogLevelPrefix\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"Capabilities\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"SecureBits\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"CapabilityBoundingSetDrop\" type=\"t\" access=\"read\"/>\n" \
@ -83,7 +83,7 @@
" <property name=\"InaccessibleDirectories\" type=\"as\" access=\"read\"/>\n" \
" <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"NoSetSID\" type=\"b\" access=\"read\"/>\n"
" <property name=\"SameProcessGroup\" type=\"b\" access=\"read\"/>\n"
#define BUS_EXEC_COMMAND_INTERFACE(name) \
" <property name=\"" name "\" type=\"a(sasttuii)\" access=\"read\"/>\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);

View File

@ -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;
}

View File

@ -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 {

View File

@ -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 }, \

View File

@ -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;