Compare commits
9 Commits
a434236acc
...
d2a56598d0
Author | SHA1 | Date |
---|---|---|
Yu Watanabe | d2a56598d0 | |
Lennart Poettering | 5bb4503d3a | |
Kevin Kuehler | 6da498c28f | |
Zbigniew Jędrzejewski-Szmek | b096d14c41 | |
Zbigniew Jędrzejewski-Szmek | e737017b85 | |
Zbigniew Jędrzejewski-Szmek | a61d68748a | |
Zbigniew Jędrzejewski-Szmek | b9d9fbe411 | |
Zbigniew Jędrzejewski-Szmek | c57d2a76c5 | |
Zbigniew Jędrzejewski-Szmek | 370f0dc81c |
|
@ -5,9 +5,9 @@ title: What settings are currently available for transient units?
|
||||||
# What settings are currently available for transient units?
|
# What settings are currently available for transient units?
|
||||||
|
|
||||||
Our intention is to make all settings that are available as unit file settings
|
Our intention is to make all settings that are available as unit file settings
|
||||||
also available for transient units, through the D-Bus API. At the moment, some
|
also available for transient units, through the D-Bus API. At the moment,
|
||||||
unit types (device, swap, target) are not supported at all via unit types,
|
device, swap, and target units are not supported at all as transient units, but
|
||||||
but most others are pretty well supported, with some notable omissions.
|
others are pretty well supported.
|
||||||
|
|
||||||
The lists below contain all settings currently available in unit files. The
|
The lists below contain all settings currently available in unit files. The
|
||||||
ones currently available in transient units are prefixed with `✓`.
|
ones currently available in transient units are prefixed with `✓`.
|
||||||
|
@ -44,15 +44,14 @@ Most generic unit settings are available for transient units.
|
||||||
✓ JobRunningTimeoutSec=
|
✓ JobRunningTimeoutSec=
|
||||||
✓ JobTimeoutAction=
|
✓ JobTimeoutAction=
|
||||||
✓ JobTimeoutRebootArgument=
|
✓ JobTimeoutRebootArgument=
|
||||||
✓ StartLimitIntervalSec=SECONDS
|
✓ StartLimitIntervalSec=
|
||||||
✓ StartLimitBurst=UNSIGNED
|
✓ StartLimitBurst=
|
||||||
✓ StartLimitAction=ACTION
|
✓ StartLimitAction=
|
||||||
✓ FailureAction=
|
✓ FailureAction=
|
||||||
✓ SuccessAction=
|
✓ SuccessAction=
|
||||||
✓ FailureActionExitStatus=
|
✓ FailureActionExitStatus=
|
||||||
✓ SuccessActionExitStatus=
|
✓ SuccessActionExitStatus=
|
||||||
✓ AddRef=
|
✓ RebootArgument=
|
||||||
✓ RebootArgument=STRING
|
|
||||||
✓ ConditionPathExists=
|
✓ ConditionPathExists=
|
||||||
✓ ConditionPathExistsGlob=
|
✓ ConditionPathExistsGlob=
|
||||||
✓ ConditionPathIsDirectory=
|
✓ ConditionPathIsDirectory=
|
||||||
|
@ -185,6 +184,7 @@ All execution-related settings are available for transient units.
|
||||||
✓ PrivateMounts=
|
✓ PrivateMounts=
|
||||||
✓ ProtectKernelTunables=
|
✓ ProtectKernelTunables=
|
||||||
✓ ProtectKernelModules=
|
✓ ProtectKernelModules=
|
||||||
|
✓ ProtectKernelLogs=
|
||||||
✓ ProtectControlGroups=
|
✓ ProtectControlGroups=
|
||||||
✓ PrivateNetwork=
|
✓ PrivateNetwork=
|
||||||
✓ PrivateUsers=
|
✓ PrivateUsers=
|
||||||
|
@ -271,6 +271,7 @@ All process killing settings are available for transient units:
|
||||||
✓ SendSIGHUP=
|
✓ SendSIGHUP=
|
||||||
✓ KillMode=
|
✓ KillMode=
|
||||||
✓ KillSignal=
|
✓ KillSignal=
|
||||||
|
✓ RestartKillSignal=
|
||||||
✓ FinalKillSignal=
|
✓ FinalKillSignal=
|
||||||
✓ WatchdogSignal=
|
✓ WatchdogSignal=
|
||||||
```
|
```
|
||||||
|
@ -310,6 +311,7 @@ Most service unit settings are available for transient units.
|
||||||
Sockets=
|
Sockets=
|
||||||
✓ USBFunctionDescriptors=
|
✓ USBFunctionDescriptors=
|
||||||
✓ USBFunctionStrings=
|
✓ USBFunctionStrings=
|
||||||
|
✓ OOMPolicy=
|
||||||
```
|
```
|
||||||
|
|
||||||
## Mount Unit Settings
|
## Mount Unit Settings
|
||||||
|
|
|
@ -309,6 +309,13 @@ static int bus_service_set_transient_property(
|
||||||
if (streq(name, "TimeoutStopUSec"))
|
if (streq(name, "TimeoutStopUSec"))
|
||||||
return bus_set_transient_usec(u, name, &s->timeout_stop_usec, message, flags, error);
|
return bus_set_transient_usec(u, name, &s->timeout_stop_usec, message, flags, error);
|
||||||
|
|
||||||
|
if (streq(name, "TimeoutAbortUSec")) {
|
||||||
|
r = bus_set_transient_usec(u, name, &s->timeout_abort_usec, message, flags, error);
|
||||||
|
if (r >= 0 && !UNIT_WRITE_FLAGS_NOOP(flags))
|
||||||
|
s->timeout_abort_set = true;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
if (streq(name, "RuntimeMaxUSec"))
|
if (streq(name, "RuntimeMaxUSec"))
|
||||||
return bus_set_transient_usec(u, name, &s->runtime_max_usec, message, flags, error);
|
return bus_set_transient_usec(u, name, &s->runtime_max_usec, message, flags, error);
|
||||||
|
|
||||||
|
|
|
@ -614,7 +614,6 @@ int config_parse_exec(
|
||||||
assert(e);
|
assert(e);
|
||||||
|
|
||||||
e += ltype;
|
e += ltype;
|
||||||
rvalue += strspn(rvalue, WHITESPACE);
|
|
||||||
|
|
||||||
if (isempty(rvalue)) {
|
if (isempty(rvalue)) {
|
||||||
/* An empty assignment resets the list */
|
/* An empty assignment resets the list */
|
||||||
|
@ -1931,6 +1930,40 @@ int config_parse_service_timeout(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int config_parse_timeout_abort(
|
||||||
|
const char *unit,
|
||||||
|
const char *filename,
|
||||||
|
unsigned line,
|
||||||
|
const char *section,
|
||||||
|
unsigned section_line,
|
||||||
|
const char *lvalue,
|
||||||
|
int ltype,
|
||||||
|
const char *rvalue,
|
||||||
|
void *data,
|
||||||
|
void *userdata) {
|
||||||
|
|
||||||
|
usec_t *ret = data;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
assert(filename);
|
||||||
|
assert(lvalue);
|
||||||
|
assert(rvalue);
|
||||||
|
assert(ret);
|
||||||
|
|
||||||
|
/* Note: apart from setting the arg, this returns an extra bit of information in the return value. */
|
||||||
|
|
||||||
|
if (isempty(rvalue)) {
|
||||||
|
*ret = 0;
|
||||||
|
return 0; /* "not set" */
|
||||||
|
}
|
||||||
|
|
||||||
|
r = parse_sec(rvalue, ret);
|
||||||
|
if (r < 0)
|
||||||
|
return log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse %s= setting, ignoring: %s", lvalue, rvalue);
|
||||||
|
|
||||||
|
return 1; /* "set" */
|
||||||
|
}
|
||||||
|
|
||||||
int config_parse_service_timeout_abort(
|
int config_parse_service_timeout_abort(
|
||||||
const char *unit,
|
const char *unit,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
|
@ -1946,24 +1979,12 @@ int config_parse_service_timeout_abort(
|
||||||
Service *s = userdata;
|
Service *s = userdata;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(filename);
|
|
||||||
assert(lvalue);
|
|
||||||
assert(rvalue);
|
|
||||||
assert(s);
|
assert(s);
|
||||||
|
|
||||||
rvalue += strspn(rvalue, WHITESPACE);
|
r = config_parse_timeout_abort(unit, filename, line, section, section_line, lvalue, ltype, rvalue,
|
||||||
if (isempty(rvalue)) {
|
&s->timeout_abort_usec, s);
|
||||||
s->timeout_abort_set = false;
|
if (r >= 0)
|
||||||
return 0;
|
s->timeout_abort_set = r;
|
||||||
}
|
|
||||||
|
|
||||||
r = parse_sec(rvalue, &s->timeout_abort_usec);
|
|
||||||
if (r < 0) {
|
|
||||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse TimeoutAbortSec= setting, ignoring: %s", rvalue);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
s->timeout_abort_set = true;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4981,39 +5002,3 @@ int config_parse_crash_chvt(
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int config_parse_timeout_abort(
|
|
||||||
const char* unit,
|
|
||||||
const char *filename,
|
|
||||||
unsigned line,
|
|
||||||
const char *section,
|
|
||||||
unsigned section_line,
|
|
||||||
const char *lvalue,
|
|
||||||
int ltype,
|
|
||||||
const char *rvalue,
|
|
||||||
void *data,
|
|
||||||
void *userdata) {
|
|
||||||
|
|
||||||
usec_t *timeout_usec = data;
|
|
||||||
int r;
|
|
||||||
|
|
||||||
assert(filename);
|
|
||||||
assert(lvalue);
|
|
||||||
assert(rvalue);
|
|
||||||
assert(timeout_usec);
|
|
||||||
|
|
||||||
rvalue += strspn(rvalue, WHITESPACE);
|
|
||||||
if (isempty(rvalue)) {
|
|
||||||
*timeout_usec = false;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = parse_sec(rvalue, timeout_usec);
|
|
||||||
if (r < 0) {
|
|
||||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse DefaultTimeoutAbortSec= setting, ignoring: %s", rvalue);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
*timeout_usec = true;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
141
src/core/main.c
141
src/core/main.c
|
@ -539,71 +539,90 @@ DEFINE_SETTER(config_parse_target, log_set_target_from_string, "target");
|
||||||
DEFINE_SETTER(config_parse_color, log_show_color_from_string, "color" );
|
DEFINE_SETTER(config_parse_color, log_show_color_from_string, "color" );
|
||||||
DEFINE_SETTER(config_parse_location, log_show_location_from_string, "location");
|
DEFINE_SETTER(config_parse_location, log_show_location_from_string, "location");
|
||||||
|
|
||||||
static int parse_config_file(void) {
|
static int config_parse_default_timeout_abort(
|
||||||
|
const char *unit,
|
||||||
|
const char *filename,
|
||||||
|
unsigned line,
|
||||||
|
const char *section,
|
||||||
|
unsigned section_line,
|
||||||
|
const char *lvalue,
|
||||||
|
int ltype,
|
||||||
|
const char *rvalue,
|
||||||
|
void *data,
|
||||||
|
void *userdata) {
|
||||||
|
int r;
|
||||||
|
|
||||||
|
r = config_parse_timeout_abort(unit, filename, line, section, section_line, lvalue, ltype, rvalue,
|
||||||
|
&arg_default_timeout_abort_usec, userdata);
|
||||||
|
if (r >= 0)
|
||||||
|
arg_default_timeout_abort_set = r;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int parse_config_file(void) {
|
||||||
const ConfigTableItem items[] = {
|
const ConfigTableItem items[] = {
|
||||||
{ "Manager", "LogLevel", config_parse_level2, 0, NULL },
|
{ "Manager", "LogLevel", config_parse_level2, 0, NULL },
|
||||||
{ "Manager", "LogTarget", config_parse_target, 0, NULL },
|
{ "Manager", "LogTarget", config_parse_target, 0, NULL },
|
||||||
{ "Manager", "LogColor", config_parse_color, 0, NULL },
|
{ "Manager", "LogColor", config_parse_color, 0, NULL },
|
||||||
{ "Manager", "LogLocation", config_parse_location, 0, NULL },
|
{ "Manager", "LogLocation", config_parse_location, 0, NULL },
|
||||||
{ "Manager", "DumpCore", config_parse_bool, 0, &arg_dump_core },
|
{ "Manager", "DumpCore", config_parse_bool, 0, &arg_dump_core },
|
||||||
{ "Manager", "CrashChVT", /* legacy */ config_parse_crash_chvt, 0, &arg_crash_chvt },
|
{ "Manager", "CrashChVT", /* legacy */ config_parse_crash_chvt, 0, &arg_crash_chvt },
|
||||||
{ "Manager", "CrashChangeVT", config_parse_crash_chvt, 0, &arg_crash_chvt },
|
{ "Manager", "CrashChangeVT", config_parse_crash_chvt, 0, &arg_crash_chvt },
|
||||||
{ "Manager", "CrashShell", config_parse_bool, 0, &arg_crash_shell },
|
{ "Manager", "CrashShell", config_parse_bool, 0, &arg_crash_shell },
|
||||||
{ "Manager", "CrashReboot", config_parse_bool, 0, &arg_crash_reboot },
|
{ "Manager", "CrashReboot", config_parse_bool, 0, &arg_crash_reboot },
|
||||||
{ "Manager", "ShowStatus", config_parse_show_status, 0, &arg_show_status },
|
{ "Manager", "ShowStatus", config_parse_show_status, 0, &arg_show_status },
|
||||||
{ "Manager", "StatusUnitFormat", config_parse_status_unit_format, 0, &arg_status_unit_format },
|
{ "Manager", "StatusUnitFormat", config_parse_status_unit_format, 0, &arg_status_unit_format },
|
||||||
{ "Manager", "CPUAffinity", config_parse_cpu_affinity2, 0, &arg_cpu_affinity },
|
{ "Manager", "CPUAffinity", config_parse_cpu_affinity2, 0, &arg_cpu_affinity },
|
||||||
{ "Manager", "NUMAPolicy", config_parse_numa_policy, 0, &arg_numa_policy.type },
|
{ "Manager", "NUMAPolicy", config_parse_numa_policy, 0, &arg_numa_policy.type },
|
||||||
{ "Manager", "NUMAMask", config_parse_numa_mask, 0, &arg_numa_policy },
|
{ "Manager", "NUMAMask", config_parse_numa_mask, 0, &arg_numa_policy },
|
||||||
{ "Manager", "JoinControllers", config_parse_warn_compat, DISABLED_CONFIGURATION, NULL },
|
{ "Manager", "JoinControllers", config_parse_warn_compat, DISABLED_CONFIGURATION, NULL },
|
||||||
{ "Manager", "RuntimeWatchdogSec", config_parse_sec, 0, &arg_runtime_watchdog },
|
{ "Manager", "RuntimeWatchdogSec", config_parse_sec, 0, &arg_runtime_watchdog },
|
||||||
{ "Manager", "RebootWatchdogSec", config_parse_sec, 0, &arg_reboot_watchdog },
|
{ "Manager", "RebootWatchdogSec", config_parse_sec, 0, &arg_reboot_watchdog },
|
||||||
{ "Manager", "ShutdownWatchdogSec", config_parse_sec, 0, &arg_reboot_watchdog }, /* obsolete alias */
|
{ "Manager", "ShutdownWatchdogSec", config_parse_sec, 0, &arg_reboot_watchdog }, /* obsolete alias */
|
||||||
{ "Manager", "KExecWatchdogSec", config_parse_sec, 0, &arg_kexec_watchdog },
|
{ "Manager", "KExecWatchdogSec", config_parse_sec, 0, &arg_kexec_watchdog },
|
||||||
{ "Manager", "WatchdogDevice", config_parse_path, 0, &arg_watchdog_device },
|
{ "Manager", "WatchdogDevice", config_parse_path, 0, &arg_watchdog_device },
|
||||||
{ "Manager", "CapabilityBoundingSet", config_parse_capability_set, 0, &arg_capability_bounding_set },
|
{ "Manager", "CapabilityBoundingSet", config_parse_capability_set, 0, &arg_capability_bounding_set },
|
||||||
{ "Manager", "NoNewPrivileges", config_parse_bool, 0, &arg_no_new_privs },
|
{ "Manager", "NoNewPrivileges", config_parse_bool, 0, &arg_no_new_privs },
|
||||||
#if HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
{ "Manager", "SystemCallArchitectures", config_parse_syscall_archs, 0, &arg_syscall_archs },
|
{ "Manager", "SystemCallArchitectures", config_parse_syscall_archs, 0, &arg_syscall_archs },
|
||||||
#endif
|
#endif
|
||||||
{ "Manager", "TimerSlackNSec", config_parse_nsec, 0, &arg_timer_slack_nsec },
|
{ "Manager", "TimerSlackNSec", config_parse_nsec, 0, &arg_timer_slack_nsec },
|
||||||
{ "Manager", "DefaultTimerAccuracySec", config_parse_sec, 0, &arg_default_timer_accuracy_usec },
|
{ "Manager", "DefaultTimerAccuracySec", config_parse_sec, 0, &arg_default_timer_accuracy_usec },
|
||||||
{ "Manager", "DefaultStandardOutput", config_parse_output_restricted, 0, &arg_default_std_output },
|
{ "Manager", "DefaultStandardOutput", config_parse_output_restricted, 0, &arg_default_std_output },
|
||||||
{ "Manager", "DefaultStandardError", config_parse_output_restricted, 0, &arg_default_std_error },
|
{ "Manager", "DefaultStandardError", config_parse_output_restricted, 0, &arg_default_std_error },
|
||||||
{ "Manager", "DefaultTimeoutStartSec", config_parse_sec, 0, &arg_default_timeout_start_usec },
|
{ "Manager", "DefaultTimeoutStartSec", config_parse_sec, 0, &arg_default_timeout_start_usec },
|
||||||
{ "Manager", "DefaultTimeoutStopSec", config_parse_sec, 0, &arg_default_timeout_stop_usec },
|
{ "Manager", "DefaultTimeoutStopSec", config_parse_sec, 0, &arg_default_timeout_stop_usec },
|
||||||
{ "Manager", "DefaultTimeoutAbortSec", config_parse_timeout_abort, 0, &arg_default_timeout_abort_set },
|
{ "Manager", "DefaultTimeoutAbortSec", config_parse_default_timeout_abort, 0, NULL },
|
||||||
{ "Manager", "DefaultRestartSec", config_parse_sec, 0, &arg_default_restart_usec },
|
{ "Manager", "DefaultRestartSec", config_parse_sec, 0, &arg_default_restart_usec },
|
||||||
{ "Manager", "DefaultStartLimitInterval", config_parse_sec, 0, &arg_default_start_limit_interval }, /* obsolete alias */
|
{ "Manager", "DefaultStartLimitInterval", config_parse_sec, 0, &arg_default_start_limit_interval }, /* obsolete alias */
|
||||||
{ "Manager", "DefaultStartLimitIntervalSec", config_parse_sec, 0, &arg_default_start_limit_interval },
|
{ "Manager", "DefaultStartLimitIntervalSec", config_parse_sec, 0, &arg_default_start_limit_interval },
|
||||||
{ "Manager", "DefaultStartLimitBurst", config_parse_unsigned, 0, &arg_default_start_limit_burst },
|
{ "Manager", "DefaultStartLimitBurst", config_parse_unsigned, 0, &arg_default_start_limit_burst },
|
||||||
{ "Manager", "DefaultEnvironment", config_parse_environ, 0, &arg_default_environment },
|
{ "Manager", "DefaultEnvironment", config_parse_environ, 0, &arg_default_environment },
|
||||||
{ "Manager", "DefaultLimitCPU", config_parse_rlimit, RLIMIT_CPU, arg_default_rlimit },
|
{ "Manager", "DefaultLimitCPU", config_parse_rlimit, RLIMIT_CPU, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitFSIZE", config_parse_rlimit, RLIMIT_FSIZE, arg_default_rlimit },
|
{ "Manager", "DefaultLimitFSIZE", config_parse_rlimit, RLIMIT_FSIZE, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitDATA", config_parse_rlimit, RLIMIT_DATA, arg_default_rlimit },
|
{ "Manager", "DefaultLimitDATA", config_parse_rlimit, RLIMIT_DATA, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitSTACK", config_parse_rlimit, RLIMIT_STACK, arg_default_rlimit },
|
{ "Manager", "DefaultLimitSTACK", config_parse_rlimit, RLIMIT_STACK, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitCORE", config_parse_rlimit, RLIMIT_CORE, arg_default_rlimit },
|
{ "Manager", "DefaultLimitCORE", config_parse_rlimit, RLIMIT_CORE, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitRSS", config_parse_rlimit, RLIMIT_RSS, arg_default_rlimit },
|
{ "Manager", "DefaultLimitRSS", config_parse_rlimit, RLIMIT_RSS, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitNOFILE", config_parse_rlimit, RLIMIT_NOFILE, arg_default_rlimit },
|
{ "Manager", "DefaultLimitNOFILE", config_parse_rlimit, RLIMIT_NOFILE, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitAS", config_parse_rlimit, RLIMIT_AS, arg_default_rlimit },
|
{ "Manager", "DefaultLimitAS", config_parse_rlimit, RLIMIT_AS, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitNPROC", config_parse_rlimit, RLIMIT_NPROC, arg_default_rlimit },
|
{ "Manager", "DefaultLimitNPROC", config_parse_rlimit, RLIMIT_NPROC, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitMEMLOCK", config_parse_rlimit, RLIMIT_MEMLOCK, arg_default_rlimit },
|
{ "Manager", "DefaultLimitMEMLOCK", config_parse_rlimit, RLIMIT_MEMLOCK, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitLOCKS", config_parse_rlimit, RLIMIT_LOCKS, arg_default_rlimit },
|
{ "Manager", "DefaultLimitLOCKS", config_parse_rlimit, RLIMIT_LOCKS, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitSIGPENDING", config_parse_rlimit, RLIMIT_SIGPENDING, arg_default_rlimit },
|
{ "Manager", "DefaultLimitSIGPENDING", config_parse_rlimit, RLIMIT_SIGPENDING, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitMSGQUEUE", config_parse_rlimit, RLIMIT_MSGQUEUE, arg_default_rlimit },
|
{ "Manager", "DefaultLimitMSGQUEUE", config_parse_rlimit, RLIMIT_MSGQUEUE, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitNICE", config_parse_rlimit, RLIMIT_NICE, arg_default_rlimit },
|
{ "Manager", "DefaultLimitNICE", config_parse_rlimit, RLIMIT_NICE, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitRTPRIO", config_parse_rlimit, RLIMIT_RTPRIO, arg_default_rlimit },
|
{ "Manager", "DefaultLimitRTPRIO", config_parse_rlimit, RLIMIT_RTPRIO, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultLimitRTTIME", config_parse_rlimit, RLIMIT_RTTIME, arg_default_rlimit },
|
{ "Manager", "DefaultLimitRTTIME", config_parse_rlimit, RLIMIT_RTTIME, arg_default_rlimit },
|
||||||
{ "Manager", "DefaultCPUAccounting", config_parse_tristate, 0, &arg_default_cpu_accounting },
|
{ "Manager", "DefaultCPUAccounting", config_parse_tristate, 0, &arg_default_cpu_accounting },
|
||||||
{ "Manager", "DefaultIOAccounting", config_parse_bool, 0, &arg_default_io_accounting },
|
{ "Manager", "DefaultIOAccounting", config_parse_bool, 0, &arg_default_io_accounting },
|
||||||
{ "Manager", "DefaultIPAccounting", config_parse_bool, 0, &arg_default_ip_accounting },
|
{ "Manager", "DefaultIPAccounting", config_parse_bool, 0, &arg_default_ip_accounting },
|
||||||
{ "Manager", "DefaultBlockIOAccounting", config_parse_bool, 0, &arg_default_blockio_accounting },
|
{ "Manager", "DefaultBlockIOAccounting", config_parse_bool, 0, &arg_default_blockio_accounting },
|
||||||
{ "Manager", "DefaultMemoryAccounting", config_parse_bool, 0, &arg_default_memory_accounting },
|
{ "Manager", "DefaultMemoryAccounting", config_parse_bool, 0, &arg_default_memory_accounting },
|
||||||
{ "Manager", "DefaultTasksAccounting", config_parse_bool, 0, &arg_default_tasks_accounting },
|
{ "Manager", "DefaultTasksAccounting", config_parse_bool, 0, &arg_default_tasks_accounting },
|
||||||
{ "Manager", "DefaultTasksMax", config_parse_tasks_max, 0, &arg_default_tasks_max },
|
{ "Manager", "DefaultTasksMax", config_parse_tasks_max, 0, &arg_default_tasks_max },
|
||||||
{ "Manager", "CtrlAltDelBurstAction", config_parse_emergency_action, 0, &arg_cad_burst_action },
|
{ "Manager", "CtrlAltDelBurstAction", config_parse_emergency_action, 0, &arg_cad_burst_action },
|
||||||
{ "Manager", "DefaultOOMPolicy", config_parse_oom_policy, 0, &arg_default_oom_policy },
|
{ "Manager", "DefaultOOMPolicy", config_parse_oom_policy, 0, &arg_default_oom_policy },
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ static int retrieve_key(key_serial_t serial, char ***ret) {
|
||||||
n = keyctl(KEYCTL_READ, (unsigned long) serial, (unsigned long) p, (unsigned long) m, 0);
|
n = keyctl(KEYCTL_READ, (unsigned long) serial, (unsigned long) p, (unsigned long) m, 0);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
if ((size_t) n < m) {
|
if ((size_t) n <= m) {
|
||||||
nfinal = (size_t) n;
|
nfinal = (size_t) n;
|
||||||
pfinal = TAKE_PTR(p);
|
pfinal = TAKE_PTR(p);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -421,18 +421,26 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons
|
||||||
if (STR_IN_SET(field, "DevicePolicy", "Slice"))
|
if (STR_IN_SET(field, "DevicePolicy", "Slice"))
|
||||||
return bus_append_string(m, field, eq);
|
return bus_append_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "CPUAccounting",
|
||||||
"CPUAccounting", "MemoryAccounting", "IOAccounting", "BlockIOAccounting",
|
"MemoryAccounting",
|
||||||
"TasksAccounting", "IPAccounting"))
|
"IOAccounting",
|
||||||
|
"BlockIOAccounting",
|
||||||
|
"TasksAccounting",
|
||||||
|
"IPAccounting"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "CPUWeight", "StartupCPUWeight", "IOWeight", "StartupIOWeight"))
|
if (STR_IN_SET(field, "CPUWeight",
|
||||||
|
"StartupCPUWeight",
|
||||||
|
"IOWeight",
|
||||||
|
"StartupIOWeight"))
|
||||||
return bus_append_cg_weight_parse(m, field, eq);
|
return bus_append_cg_weight_parse(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "CPUShares", "StartupCPUShares"))
|
if (STR_IN_SET(field, "CPUShares",
|
||||||
|
"StartupCPUShares"))
|
||||||
return bus_append_cg_cpu_shares_parse(m, field, eq);
|
return bus_append_cg_cpu_shares_parse(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "AllowedCPUs", "AllowedMemoryNodes")) {
|
if (STR_IN_SET(field, "AllowedCPUs",
|
||||||
|
"AllowedMemoryNodes")) {
|
||||||
_cleanup_(cpu_set_reset) CPUSet cpuset = {};
|
_cleanup_(cpu_set_reset) CPUSet cpuset = {};
|
||||||
_cleanup_free_ uint8_t *array = NULL;
|
_cleanup_free_ uint8_t *array = NULL;
|
||||||
size_t allocated;
|
size_t allocated;
|
||||||
|
@ -448,7 +456,8 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons
|
||||||
return bus_append_byte_array(m, field, array, allocated);
|
return bus_append_byte_array(m, field, array, allocated);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "BlockIOWeight", "StartupBlockIOWeight"))
|
if (STR_IN_SET(field, "BlockIOWeight",
|
||||||
|
"StartupBlockIOWeight"))
|
||||||
return bus_append_cg_blkio_weight_parse(m, field, eq);
|
return bus_append_cg_blkio_weight_parse(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "DisableControllers"))
|
if (streq(field, "DisableControllers"))
|
||||||
|
@ -593,7 +602,8 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "IODeviceWeight", "BlockIODeviceWeight")) {
|
if (STR_IN_SET(field, "IODeviceWeight",
|
||||||
|
"BlockIODeviceWeight")) {
|
||||||
if (isempty(eq))
|
if (isempty(eq))
|
||||||
r = sd_bus_message_append(m, "(sv)", field, "a(st)", 0);
|
r = sd_bus_message_append(m, "(sv)", field, "a(st)", 0);
|
||||||
else {
|
else {
|
||||||
|
@ -653,7 +663,8 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "IPAddressAllow", "IPAddressDeny")) {
|
if (STR_IN_SET(field, "IPAddressAllow",
|
||||||
|
"IPAddressDeny")) {
|
||||||
unsigned char prefixlen;
|
unsigned char prefixlen;
|
||||||
union in_addr_union prefix = {};
|
union in_addr_union prefix = {};
|
||||||
int family;
|
int family;
|
||||||
|
@ -773,7 +784,8 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "IPIngressFilterPath", "IPEgressFilterPath")) {
|
if (STR_IN_SET(field, "IPIngressFilterPath",
|
||||||
|
"IPEgressFilterPath")) {
|
||||||
if (isempty(eq))
|
if (isempty(eq))
|
||||||
r = sd_bus_message_append(m, "(sv)", field, "as", 0);
|
r = sd_bus_message_append(m, "(sv)", field, "as", 0);
|
||||||
else
|
else
|
||||||
|
@ -805,31 +817,68 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
const char *suffix;
|
const char *suffix;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "User",
|
||||||
"User", "Group",
|
"Group",
|
||||||
"UtmpIdentifier", "UtmpMode", "PAMName", "TTYPath",
|
"UtmpIdentifier",
|
||||||
"WorkingDirectory", "RootDirectory", "SyslogIdentifier",
|
"UtmpMode",
|
||||||
"ProtectSystem", "ProtectHome", "SELinuxContext", "RootImage",
|
"PAMName",
|
||||||
"RuntimeDirectoryPreserve", "Personality", "KeyringMode", "NetworkNamespacePath"))
|
"TTYPath",
|
||||||
|
"WorkingDirectory",
|
||||||
|
"RootDirectory",
|
||||||
|
"SyslogIdentifier",
|
||||||
|
"ProtectSystem",
|
||||||
|
"ProtectHome",
|
||||||
|
"SELinuxContext",
|
||||||
|
"RootImage",
|
||||||
|
"RuntimeDirectoryPreserve",
|
||||||
|
"Personality",
|
||||||
|
"KeyringMode",
|
||||||
|
"NetworkNamespacePath"))
|
||||||
return bus_append_string(m, field, eq);
|
return bus_append_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "IgnoreSIGPIPE",
|
||||||
"IgnoreSIGPIPE", "TTYVHangup", "TTYReset", "TTYVTDisallocate", "PrivateTmp",
|
"TTYVHangup",
|
||||||
"PrivateDevices", "PrivateNetwork", "PrivateUsers", "PrivateMounts",
|
"TTYReset",
|
||||||
"NoNewPrivileges", "SyslogLevelPrefix", "MemoryDenyWriteExecute", "RestrictRealtime",
|
"TTYVTDisallocate",
|
||||||
"DynamicUser", "RemoveIPC", "ProtectKernelTunables", "ProtectKernelModules",
|
"PrivateTmp",
|
||||||
"ProtectKernelLogs", "ProtectControlGroups", "MountAPIVFS", "CPUSchedulingResetOnFork",
|
"PrivateDevices",
|
||||||
"LockPersonality", "ProtectHostname", "RestrictSUIDSGID"))
|
"PrivateNetwork",
|
||||||
|
"PrivateUsers",
|
||||||
|
"PrivateMounts",
|
||||||
|
"NoNewPrivileges",
|
||||||
|
"SyslogLevelPrefix",
|
||||||
|
"MemoryDenyWriteExecute",
|
||||||
|
"RestrictRealtime",
|
||||||
|
"DynamicUser",
|
||||||
|
"RemoveIPC",
|
||||||
|
"ProtectKernelTunables",
|
||||||
|
"ProtectKernelModules",
|
||||||
|
"ProtectKernelLogs",
|
||||||
|
"ProtectControlGroups",
|
||||||
|
"MountAPIVFS",
|
||||||
|
"CPUSchedulingResetOnFork",
|
||||||
|
"LockPersonality",
|
||||||
|
"ProtectHostname",
|
||||||
|
"RestrictSUIDSGID"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "ReadWriteDirectories",
|
||||||
"ReadWriteDirectories", "ReadOnlyDirectories", "InaccessibleDirectories",
|
"ReadOnlyDirectories",
|
||||||
"ReadWritePaths", "ReadOnlyPaths", "InaccessiblePaths",
|
"InaccessibleDirectories",
|
||||||
"RuntimeDirectory", "StateDirectory", "CacheDirectory", "LogsDirectory", "ConfigurationDirectory",
|
"ReadWritePaths",
|
||||||
"SupplementaryGroups", "SystemCallArchitectures"))
|
"ReadOnlyPaths",
|
||||||
|
"InaccessiblePaths",
|
||||||
|
"RuntimeDirectory",
|
||||||
|
"StateDirectory",
|
||||||
|
"CacheDirectory",
|
||||||
|
"LogsDirectory",
|
||||||
|
"ConfigurationDirectory",
|
||||||
|
"SupplementaryGroups",
|
||||||
|
"SystemCallArchitectures"))
|
||||||
return bus_append_strv(m, field, eq, EXTRACT_UNQUOTE);
|
return bus_append_strv(m, field, eq, EXTRACT_UNQUOTE);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "SyslogLevel", "LogLevelMax"))
|
if (STR_IN_SET(field, "SyslogLevel",
|
||||||
|
"LogLevelMax"))
|
||||||
return bus_append_log_level_from_string(m, field, eq);
|
return bus_append_log_level_from_string(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "SyslogFacility"))
|
if (streq(field, "SyslogFacility"))
|
||||||
|
@ -841,7 +890,8 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
if (streq(field, "CPUSchedulingPolicy"))
|
if (streq(field, "CPUSchedulingPolicy"))
|
||||||
return bus_append_sched_policy_from_string(m, field, eq);
|
return bus_append_sched_policy_from_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "CPUSchedulingPriority", "OOMScoreAdjust"))
|
if (STR_IN_SET(field, "CPUSchedulingPriority",
|
||||||
|
"OOMScoreAdjust"))
|
||||||
return bus_append_safe_atoi(m, field, eq);
|
return bus_append_safe_atoi(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "Nice"))
|
if (streq(field, "Nice"))
|
||||||
|
@ -856,9 +906,12 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
if (streq(field, "IOSchedulingPriority"))
|
if (streq(field, "IOSchedulingPriority"))
|
||||||
return bus_append_ioprio_parse_priority(m, field, eq);
|
return bus_append_ioprio_parse_priority(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "RuntimeDirectoryMode",
|
||||||
"RuntimeDirectoryMode", "StateDirectoryMode", "CacheDirectoryMode",
|
"StateDirectoryMode",
|
||||||
"LogsDirectoryMode", "ConfigurationDirectoryMode", "UMask"))
|
"CacheDirectoryMode",
|
||||||
|
"LogsDirectoryMode",
|
||||||
|
"ConfigurationDirectoryMode",
|
||||||
|
"UMask"))
|
||||||
return bus_append_parse_mode(m, field, eq);
|
return bus_append_parse_mode(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "TimerSlackNSec"))
|
if (streq(field, "TimerSlackNSec"))
|
||||||
|
@ -873,7 +926,9 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
if (streq(field, "MountFlags"))
|
if (streq(field, "MountFlags"))
|
||||||
return bus_append_mount_propagation_flags_from_string(m, field, eq);
|
return bus_append_mount_propagation_flags_from_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "Environment", "UnsetEnvironment", "PassEnvironment"))
|
if (STR_IN_SET(field, "Environment",
|
||||||
|
"UnsetEnvironment",
|
||||||
|
"PassEnvironment"))
|
||||||
return bus_append_strv(m, field, eq, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE);
|
return bus_append_strv(m, field, eq, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE);
|
||||||
|
|
||||||
if (streq(field, "EnvironmentFile")) {
|
if (streq(field, "EnvironmentFile")) {
|
||||||
|
@ -925,7 +980,9 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "StandardInput", "StandardOutput", "StandardError")) {
|
if (STR_IN_SET(field, "StandardInput",
|
||||||
|
"StandardOutput",
|
||||||
|
"StandardError")) {
|
||||||
const char *n, *appended;
|
const char *n, *appended;
|
||||||
|
|
||||||
if ((n = startswith(eq, "fd:"))) {
|
if ((n = startswith(eq, "fd:"))) {
|
||||||
|
@ -997,7 +1054,8 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "AppArmorProfile", "SmackProcessLabel")) {
|
if (STR_IN_SET(field, "AppArmorProfile",
|
||||||
|
"SmackProcessLabel")) {
|
||||||
int ignore = 0;
|
int ignore = 0;
|
||||||
const char *s = eq;
|
const char *s = eq;
|
||||||
|
|
||||||
|
@ -1013,7 +1071,8 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "CapabilityBoundingSet", "AmbientCapabilities")) {
|
if (STR_IN_SET(field, "CapabilityBoundingSet",
|
||||||
|
"AmbientCapabilities")) {
|
||||||
uint64_t sum = 0;
|
uint64_t sum = 0;
|
||||||
bool invert = false;
|
bool invert = false;
|
||||||
const char *p = eq;
|
const char *p = eq;
|
||||||
|
@ -1080,7 +1139,8 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
return bus_append_byte_array(m, field, array, allocated);
|
return bus_append_byte_array(m, field, array, allocated);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "RestrictAddressFamilies", "SystemCallFilter")) {
|
if (STR_IN_SET(field, "RestrictAddressFamilies",
|
||||||
|
"SystemCallFilter")) {
|
||||||
int whitelist = 1;
|
int whitelist = 1;
|
||||||
const char *p = eq;
|
const char *p = eq;
|
||||||
|
|
||||||
|
@ -1178,7 +1238,8 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STR_IN_SET(field, "BindPaths", "BindReadOnlyPaths")) {
|
if (STR_IN_SET(field, "BindPaths",
|
||||||
|
"BindReadOnlyPaths")) {
|
||||||
const char *p = eq;
|
const char *p = eq;
|
||||||
|
|
||||||
r = sd_bus_message_open_container(m, SD_BUS_TYPE_STRUCT, "sv");
|
r = sd_bus_message_open_container(m, SD_BUS_TYPE_STRUCT, "sv");
|
||||||
|
@ -1330,10 +1391,14 @@ static int bus_append_kill_property(sd_bus_message *m, const char *field, const
|
||||||
if (streq(field, "KillMode"))
|
if (streq(field, "KillMode"))
|
||||||
return bus_append_string(m, field, eq);
|
return bus_append_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "SendSIGHUP", "SendSIGKILL"))
|
if (STR_IN_SET(field, "SendSIGHUP",
|
||||||
|
"SendSIGKILL"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "KillSignal", "RestartKillSignal", "FinalKillSignal", "WatchdogSignal"))
|
if (STR_IN_SET(field, "KillSignal",
|
||||||
|
"RestartKillSignal",
|
||||||
|
"FinalKillSignal",
|
||||||
|
"WatchdogSignal"))
|
||||||
return bus_append_signal_from_string(m, field, eq);
|
return bus_append_signal_from_string(m, field, eq);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1341,7 +1406,10 @@ static int bus_append_kill_property(sd_bus_message *m, const char *field, const
|
||||||
|
|
||||||
static int bus_append_mount_property(sd_bus_message *m, const char *field, const char *eq) {
|
static int bus_append_mount_property(sd_bus_message *m, const char *field, const char *eq) {
|
||||||
|
|
||||||
if (STR_IN_SET(field, "What", "Where", "Options", "Type"))
|
if (STR_IN_SET(field, "What",
|
||||||
|
"Where",
|
||||||
|
"Options",
|
||||||
|
"Type"))
|
||||||
return bus_append_string(m, field, eq);
|
return bus_append_string(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "TimeoutSec"))
|
if (streq(field, "TimeoutSec"))
|
||||||
|
@ -1350,7 +1418,9 @@ static int bus_append_mount_property(sd_bus_message *m, const char *field, const
|
||||||
if (streq(field, "DirectoryMode"))
|
if (streq(field, "DirectoryMode"))
|
||||||
return bus_append_parse_mode(m, field, eq);
|
return bus_append_parse_mode(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "SloppyOptions", "LazyUnmount", "ForceUnmount"))
|
if (STR_IN_SET(field, "SloppyOptions",
|
||||||
|
"LazyUnmount",
|
||||||
|
"ForceUnmount"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1365,9 +1435,11 @@ static int bus_append_path_property(sd_bus_message *m, const char *field, const
|
||||||
if (streq(field, "DirectoryMode"))
|
if (streq(field, "DirectoryMode"))
|
||||||
return bus_append_parse_mode(m, field, eq);
|
return bus_append_parse_mode(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "PathExists",
|
||||||
"PathExists", "PathExistsGlob", "PathChanged",
|
"PathExistsGlob",
|
||||||
"PathModified", "DirectoryNotEmpty")) {
|
"PathChanged",
|
||||||
|
"PathModified",
|
||||||
|
"DirectoryNotEmpty")) {
|
||||||
if (isempty(eq))
|
if (isempty(eq))
|
||||||
r = sd_bus_message_append(m, "(sv)", "Paths", "a(ss)", 0);
|
r = sd_bus_message_append(m, "(sv)", "Paths", "a(ss)", 0);
|
||||||
else
|
else
|
||||||
|
@ -1383,11 +1455,9 @@ static int bus_append_path_property(sd_bus_message *m, const char *field, const
|
||||||
|
|
||||||
static int bus_append_scope_property(sd_bus_message *m, const char *field, const char *eq) {
|
static int bus_append_scope_property(sd_bus_message *m, const char *field, const char *eq) {
|
||||||
if (streq(field, "RuntimeMaxSec"))
|
if (streq(field, "RuntimeMaxSec"))
|
||||||
|
|
||||||
return bus_append_parse_sec_rename(m, field, eq);
|
return bus_append_parse_sec_rename(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "TimeoutStopSec"))
|
if (streq(field, "TimeoutStopSec"))
|
||||||
|
|
||||||
return bus_append_parse_sec_rename(m, field, eq);
|
return bus_append_parse_sec_rename(m, field, eq);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1396,15 +1466,28 @@ static int bus_append_scope_property(sd_bus_message *m, const char *field, const
|
||||||
static int bus_append_service_property(sd_bus_message *m, const char *field, const char *eq) {
|
static int bus_append_service_property(sd_bus_message *m, const char *field, const char *eq) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "PIDFile",
|
||||||
"PIDFile", "Type", "Restart", "BusName", "NotifyAccess",
|
"Type",
|
||||||
"USBFunctionDescriptors", "USBFunctionStrings", "OOMPolicy"))
|
"Restart",
|
||||||
|
"BusName",
|
||||||
|
"NotifyAccess",
|
||||||
|
"USBFunctionDescriptors",
|
||||||
|
"USBFunctionStrings",
|
||||||
|
"OOMPolicy"))
|
||||||
return bus_append_string(m, field, eq);
|
return bus_append_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "PermissionsStartOnly", "RootDirectoryStartOnly", "RemainAfterExit", "GuessMainPID"))
|
if (STR_IN_SET(field, "PermissionsStartOnly",
|
||||||
|
"RootDirectoryStartOnly",
|
||||||
|
"RemainAfterExit",
|
||||||
|
"GuessMainPID"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "RestartSec", "TimeoutStartSec", "TimeoutStopSec", "RuntimeMaxSec", "WatchdogSec"))
|
if (STR_IN_SET(field, "RestartSec",
|
||||||
|
"TimeoutStartSec",
|
||||||
|
"TimeoutStopSec",
|
||||||
|
"TimeoutAbortSec",
|
||||||
|
"RuntimeMaxSec",
|
||||||
|
"WatchdogSec"))
|
||||||
return bus_append_parse_sec_rename(m, field, eq);
|
return bus_append_parse_sec_rename(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "TimeoutSec")) {
|
if (streq(field, "TimeoutSec")) {
|
||||||
|
@ -1418,14 +1501,25 @@ static int bus_append_service_property(sd_bus_message *m, const char *field, con
|
||||||
if (streq(field, "FileDescriptorStoreMax"))
|
if (streq(field, "FileDescriptorStoreMax"))
|
||||||
return bus_append_safe_atou(m, field, eq);
|
return bus_append_safe_atou(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "ExecCondition",
|
||||||
"ExecCondition", "ExecStartPre", "ExecStart", "ExecStartPost",
|
"ExecStartPre",
|
||||||
"ExecConditionEx", "ExecStartPreEx", "ExecStartEx", "ExecStartPostEx",
|
"ExecStart",
|
||||||
"ExecReload", "ExecStop", "ExecStopPost",
|
"ExecStartPost",
|
||||||
"ExecReloadEx", "ExecStopEx", "ExecStopPostEx"))
|
"ExecConditionEx",
|
||||||
|
"ExecStartPreEx",
|
||||||
|
"ExecStartEx",
|
||||||
|
"ExecStartPostEx",
|
||||||
|
"ExecReload",
|
||||||
|
"ExecStop",
|
||||||
|
"ExecStopPost",
|
||||||
|
"ExecReloadEx",
|
||||||
|
"ExecStopEx",
|
||||||
|
"ExecStopPostEx"))
|
||||||
return bus_append_exec_command(m, field, eq);
|
return bus_append_exec_command(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "RestartPreventExitStatus", "RestartForceExitStatus", "SuccessExitStatus")) {
|
if (STR_IN_SET(field, "RestartPreventExitStatus",
|
||||||
|
"RestartForceExitStatus",
|
||||||
|
"SuccessExitStatus")) {
|
||||||
_cleanup_free_ int *status = NULL, *signal = NULL;
|
_cleanup_free_ int *status = NULL, *signal = NULL;
|
||||||
size_t n_status = 0, n_signal = 0;
|
size_t n_status = 0, n_signal = 0;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
@ -1512,39 +1606,70 @@ static int bus_append_service_property(sd_bus_message *m, const char *field, con
|
||||||
static int bus_append_socket_property(sd_bus_message *m, const char *field, const char *eq) {
|
static int bus_append_socket_property(sd_bus_message *m, const char *field, const char *eq) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "Accept",
|
||||||
"Accept", "Writable", "KeepAlive", "NoDelay", "FreeBind", "Transparent", "Broadcast",
|
"Writable",
|
||||||
"PassCredentials", "PassSecurity", "ReusePort", "RemoveOnStop", "SELinuxContextFromNet"))
|
"KeepAlive",
|
||||||
|
"NoDelay",
|
||||||
|
"FreeBind",
|
||||||
|
"Transparent",
|
||||||
|
"Broadcast",
|
||||||
|
"PassCredentials",
|
||||||
|
"PassSecurity",
|
||||||
|
"ReusePort",
|
||||||
|
"RemoveOnStop",
|
||||||
|
"SELinuxContextFromNet"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "Priority", "IPTTL", "Mark"))
|
if (STR_IN_SET(field, "Priority",
|
||||||
|
"IPTTL",
|
||||||
|
"Mark"))
|
||||||
return bus_append_safe_atoi(m, field, eq);
|
return bus_append_safe_atoi(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "IPTOS"))
|
if (streq(field, "IPTOS"))
|
||||||
return bus_append_ip_tos_from_string(m, field, eq);
|
return bus_append_ip_tos_from_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "Backlog", "MaxConnections", "MaxConnectionsPerSource", "KeepAliveProbes", "TriggerLimitBurst"))
|
if (STR_IN_SET(field, "Backlog",
|
||||||
|
"MaxConnections",
|
||||||
|
"MaxConnectionsPerSource",
|
||||||
|
"KeepAliveProbes",
|
||||||
|
"TriggerLimitBurst"))
|
||||||
return bus_append_safe_atou(m, field, eq);
|
return bus_append_safe_atou(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "SocketMode", "DirectoryMode"))
|
if (STR_IN_SET(field, "SocketMode",
|
||||||
|
"DirectoryMode"))
|
||||||
return bus_append_parse_mode(m, field, eq);
|
return bus_append_parse_mode(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "MessageQueueMaxMessages", "MessageQueueMessageSize"))
|
if (STR_IN_SET(field, "MessageQueueMaxMessages",
|
||||||
|
"MessageQueueMessageSize"))
|
||||||
return bus_append_safe_atoi64(m, field, eq);
|
return bus_append_safe_atoi64(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "TimeoutSec", "KeepAliveTimeSec", "KeepAliveIntervalSec", "DeferAcceptSec", "TriggerLimitIntervalSec"))
|
if (STR_IN_SET(field, "TimeoutSec",
|
||||||
|
"KeepAliveTimeSec",
|
||||||
|
"KeepAliveIntervalSec",
|
||||||
|
"DeferAcceptSec",
|
||||||
|
"TriggerLimitIntervalSec"))
|
||||||
return bus_append_parse_sec_rename(m, field, eq);
|
return bus_append_parse_sec_rename(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "ReceiveBuffer", "SendBuffer", "PipeSize"))
|
if (STR_IN_SET(field, "ReceiveBuffer",
|
||||||
|
"SendBuffer",
|
||||||
|
"PipeSize"))
|
||||||
return bus_append_parse_size(m, field, eq, 1024);
|
return bus_append_parse_size(m, field, eq, 1024);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "ExecStartPre", "ExecStartPost", "ExecReload", "ExecStopPost"))
|
if (STR_IN_SET(field, "ExecStartPre",
|
||||||
|
"ExecStartPost",
|
||||||
|
"ExecReload",
|
||||||
|
"ExecStopPost"))
|
||||||
return bus_append_exec_command(m, field, eq);
|
return bus_append_exec_command(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "SmackLabel",
|
||||||
"SmackLabel", "SmackLabelIPIn", "SmackLabelIPOut", "TCPCongestion",
|
"SmackLabelIPIn",
|
||||||
"BindToDevice", "BindIPv6Only", "FileDescriptorName",
|
"SmackLabelIPOut",
|
||||||
"SocketUser", "SocketGroup"))
|
"TCPCongestion",
|
||||||
|
"BindToDevice",
|
||||||
|
"BindIPv6Only",
|
||||||
|
"FileDescriptorName",
|
||||||
|
"SocketUser",
|
||||||
|
"SocketGroup"))
|
||||||
return bus_append_string(m, field, eq);
|
return bus_append_string(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "Symlinks"))
|
if (streq(field, "Symlinks"))
|
||||||
|
@ -1553,9 +1678,14 @@ static int bus_append_socket_property(sd_bus_message *m, const char *field, cons
|
||||||
if (streq(field, "SocketProtocol"))
|
if (streq(field, "SocketProtocol"))
|
||||||
return bus_append_parse_ip_protocol(m, field, eq);
|
return bus_append_parse_ip_protocol(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "ListenStream",
|
||||||
"ListenStream", "ListenDatagram", "ListenSequentialPacket", "ListenNetlink",
|
"ListenDatagram",
|
||||||
"ListenSpecial", "ListenMessageQueue", "ListenFIFO", "ListenUSBFunction")) {
|
"ListenSequentialPacket",
|
||||||
|
"ListenNetlink",
|
||||||
|
"ListenSpecial",
|
||||||
|
"ListenMessageQueue",
|
||||||
|
"ListenFIFO",
|
||||||
|
"ListenUSBFunction")) {
|
||||||
if (isempty(eq))
|
if (isempty(eq))
|
||||||
r = sd_bus_message_append(m, "(sv)", "Listen", "a(ss)", 0);
|
r = sd_bus_message_append(m, "(sv)", "Listen", "a(ss)", 0);
|
||||||
else
|
else
|
||||||
|
@ -1571,16 +1701,22 @@ static int bus_append_socket_property(sd_bus_message *m, const char *field, cons
|
||||||
static int bus_append_timer_property(sd_bus_message *m, const char *field, const char *eq) {
|
static int bus_append_timer_property(sd_bus_message *m, const char *field, const char *eq) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (STR_IN_SET(field, "WakeSystem", "RemainAfterElapse", "Persistent",
|
if (STR_IN_SET(field, "WakeSystem",
|
||||||
"OnTimezoneChange", "OnClockChange"))
|
"RemainAfterElapse",
|
||||||
|
"Persistent",
|
||||||
|
"OnTimezoneChange",
|
||||||
|
"OnClockChange"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "AccuracySec", "RandomizedDelaySec"))
|
if (STR_IN_SET(field, "AccuracySec",
|
||||||
|
"RandomizedDelaySec"))
|
||||||
return bus_append_parse_sec_rename(m, field, eq);
|
return bus_append_parse_sec_rename(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "OnActiveSec",
|
||||||
"OnActiveSec", "OnBootSec", "OnStartupSec",
|
"OnBootSec",
|
||||||
"OnUnitActiveSec","OnUnitInactiveSec")) {
|
"OnStartupSec",
|
||||||
|
"OnUnitActiveSec",
|
||||||
|
"OnUnitInactiveSec")) {
|
||||||
if (isempty(eq))
|
if (isempty(eq))
|
||||||
r = sd_bus_message_append(m, "(sv)", "TimersMonotonic", "a(st)", 0);
|
r = sd_bus_message_append(m, "(sv)", "TimersMonotonic", "a(st)", 0);
|
||||||
else {
|
else {
|
||||||
|
@ -1616,25 +1752,36 @@ static int bus_append_unit_property(sd_bus_message *m, const char *field, const
|
||||||
bool is_condition = false;
|
bool is_condition = false;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "Description",
|
||||||
"Description", "SourcePath", "OnFailureJobMode",
|
"SourcePath",
|
||||||
"JobTimeoutAction", "JobTimeoutRebootArgument",
|
"OnFailureJobMode",
|
||||||
"StartLimitAction", "FailureAction", "SuccessAction",
|
"JobTimeoutAction",
|
||||||
"RebootArgument", "CollectMode"))
|
"JobTimeoutRebootArgument",
|
||||||
|
"StartLimitAction",
|
||||||
|
"FailureAction",
|
||||||
|
"SuccessAction",
|
||||||
|
"RebootArgument",
|
||||||
|
"CollectMode"))
|
||||||
return bus_append_string(m, field, eq);
|
return bus_append_string(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field,
|
if (STR_IN_SET(field, "StopWhenUnneeded",
|
||||||
"StopWhenUnneeded", "RefuseManualStart", "RefuseManualStop",
|
"RefuseManualStart",
|
||||||
"AllowIsolate", "IgnoreOnIsolate", "DefaultDependencies"))
|
"RefuseManualStop",
|
||||||
|
"AllowIsolate",
|
||||||
|
"IgnoreOnIsolate",
|
||||||
|
"DefaultDependencies"))
|
||||||
return bus_append_parse_boolean(m, field, eq);
|
return bus_append_parse_boolean(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "JobTimeoutSec", "JobRunningTimeoutSec", "StartLimitIntervalSec"))
|
if (STR_IN_SET(field, "JobTimeoutSec",
|
||||||
|
"JobRunningTimeoutSec",
|
||||||
|
"StartLimitIntervalSec"))
|
||||||
return bus_append_parse_sec_rename(m, field, eq);
|
return bus_append_parse_sec_rename(m, field, eq);
|
||||||
|
|
||||||
if (streq(field, "StartLimitBurst"))
|
if (streq(field, "StartLimitBurst"))
|
||||||
return bus_append_safe_atou(m, field, eq);
|
return bus_append_safe_atou(m, field, eq);
|
||||||
|
|
||||||
if (STR_IN_SET(field, "SuccessActionExitStatus", "FailureActionExitStatus")) {
|
if (STR_IN_SET(field, "SuccessActionExitStatus",
|
||||||
|
"FailureActionExitStatus")) {
|
||||||
if (isempty(eq))
|
if (isempty(eq))
|
||||||
r = sd_bus_message_append(m, "(sv)", field, "i", -1);
|
r = sd_bus_message_append(m, "(sv)", field, "i", -1);
|
||||||
else {
|
else {
|
||||||
|
@ -1653,7 +1800,8 @@ static int bus_append_unit_property(sd_bus_message *m, const char *field, const
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unit_dependency_from_string(field) >= 0 ||
|
if (unit_dependency_from_string(field) >= 0 ||
|
||||||
STR_IN_SET(field, "Documentation", "RequiresMountsFor"))
|
STR_IN_SET(field, "Documentation",
|
||||||
|
"RequiresMountsFor"))
|
||||||
return bus_append_strv(m, field, eq, EXTRACT_UNQUOTE);
|
return bus_append_strv(m, field, eq, EXTRACT_UNQUOTE);
|
||||||
|
|
||||||
t = condition_type_from_string(field);
|
t = condition_type_from_string(field);
|
||||||
|
|
|
@ -227,8 +227,8 @@ static const char* const config_file[] = {
|
||||||
"[Section]\n"
|
"[Section]\n"
|
||||||
"[Section]\n"
|
"[Section]\n"
|
||||||
"setting1=1\n"
|
"setting1=1\n"
|
||||||
"setting1=2\n"
|
"setting1= 2 \t\n"
|
||||||
"setting1=1\n", /* repeated settings */
|
"setting1= 1\n", /* repeated settings */
|
||||||
|
|
||||||
"[Section]\n"
|
"[Section]\n"
|
||||||
"[Section]\n"
|
"[Section]\n"
|
||||||
|
|
|
@ -146,7 +146,7 @@ static void test_config_parse_exec(void) {
|
||||||
|
|
||||||
log_info("/* no command, whitespace only, reset */");
|
log_info("/* no command, whitespace only, reset */");
|
||||||
r = config_parse_exec(NULL, "fake", 3, "section", 1,
|
r = config_parse_exec(NULL, "fake", 3, "section", 1,
|
||||||
"LValue", 0, " ",
|
"LValue", 0, "",
|
||||||
&c, u);
|
&c, u);
|
||||||
assert_se(r == 0);
|
assert_se(r == 0);
|
||||||
assert_se(c == NULL);
|
assert_se(c == NULL);
|
||||||
|
|
|
@ -536,7 +536,13 @@ install_systemd() {
|
||||||
|
|
||||||
get_ldpath() {
|
get_ldpath() {
|
||||||
local _bin="$1"
|
local _bin="$1"
|
||||||
objdump -p "$_bin" 2>/dev/null | awk "/R(UN)?PATH/ { print \"$initdir\" \$2 }" | paste -sd :
|
local rpath=$(objdump -p "$_bin" 2>/dev/null | awk "/R(UN)?PATH/ { print \"$initdir\" \$2 }" | paste -sd :)
|
||||||
|
|
||||||
|
if [ -z "$rpath" ] ; then
|
||||||
|
echo $BUILD_DIR
|
||||||
|
else
|
||||||
|
echo $rpath
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install_missing_libraries() {
|
install_missing_libraries() {
|
||||||
|
|
Loading…
Reference in New Issue