return 1;
- } else if (streq(name, "WakeSystem")) {
+ } else if (STR_IN_SET(name, "WakeSystem", "Persistent", "RemainAfterElapse")) {
int b;
r = sd_bus_message_read(message, "b", &b);
return r;
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
- t->wake_system = b;
- unit_write_settingf(UNIT(t), flags, name, "%s=%s", name, yes_no(b));
- }
-
- return 1;
-
- } else if (streq(name, "RemainAfterElapse")) {
- int b;
+ if (streq(name, "WakeSystem"))
+ t->wake_system = b;
+ else if (streq(name, "Persistent"))
+ t->persistent = b;
+ else /* RemainAfterElapse */
+ t->remain_after_elapse = b;
- r = sd_bus_message_read(message, "b", &b);
- if (r < 0)
- return r;
-
- if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
- t->remain_after_elapse = b;
unit_write_settingf(UNIT(t), flags, name, "%s=%s", name, yes_no(b));
}
"TasksAccounting", "IPAccounting", "SendSIGHUP", "SendSIGKILL", "WakeSystem",
"DefaultDependencies", "IgnoreSIGPIPE", "TTYVHangup", "TTYReset", "TTYVTDisallocate",
"RemainAfterExit", "PrivateTmp", "PrivateDevices", "PrivateNetwork", "PrivateUsers",
- "NoNewPrivileges", "SyslogLevelPrefix", "RemainAfterElapse",
+ "NoNewPrivileges", "SyslogLevelPrefix", "RemainAfterElapse", "Persistent",
"MemoryDenyWriteExecute", "RestrictRealtime", "DynamicUser", "RemoveIPC",
"ProtectKernelTunables", "ProtectKernelModules", "ProtectControlGroups", "MountAPIVFS",
"CPUSchedulingResetOnFork", "LockPersonality")) {
"RootDirectory", "SyslogIdentifier", "ProtectSystem",
"ProtectHome", "SELinuxContext", "Restart", "RootImage",
"NotifyAccess", "RuntimeDirectoryPreserve", "Personality",
- "KeyringMode", "CollectMode", "FailureAction", "SuccessAction"))
+ "KeyringMode", "CollectMode", "FailureAction", "SuccessAction",
+ "OnCalendar"))
+
r = sd_bus_message_append(m, "v", "s", eq);
else if (streq(field, "StandardInputData")) {
r = sd_bus_message_close_container(m);
+ } else if (STR_IN_SET(field,
+ "OnActiveSec", "OnBootSec", "OnStartupSec",
+ "OnUnitActiveSec","OnUnitInactiveSec")) {
+ usec_t t;
+
+ r = parse_sec(eq, &t);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse %s= parameter: %s", field, eq);
+
+ r = sd_bus_message_append(m, "v", "t", t);
+
} else {
log_error("Unknown assignment: %s", assignment);
return -EINVAL;