summaryrefslogtreecommitdiffstats
path: root/src/core/service.h
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-01-26 10:44:03 +0100
committerMike Yuan <me@yhndnzj.com>2023-03-21 23:33:12 +0100
commit19dff6914dee94b36320dbfda94f60af30ac65c1 (patch)
treee574d4d48024b81901008bc65585c47d9537b616 /src/core/service.h
parentMerge pull request #26893 from yuwata/uki-util-update-log (diff)
downloadsystemd-19dff6914dee94b36320dbfda94f60af30ac65c1.tar.xz
systemd-19dff6914dee94b36320dbfda94f60af30ac65c1.zip
core: support overriding NOTIFYACCESS= through sd-notify during runtime
Closes #25963
Diffstat (limited to 'src/core/service.h')
-rw-r--r--src/core/service.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/service.h b/src/core/service.h
index fd242a7cbf..7663f26f70 100644
--- a/src/core/service.h
+++ b/src/core/service.h
@@ -195,6 +195,7 @@ struct Service {
PathSpec *pid_file_pathspec;
NotifyAccess notify_access;
+ NotifyAccess notify_access_override;
NotifyState notify_state;
sd_bus_slot *bus_name_pid_lookup_slot;
@@ -229,6 +230,11 @@ static inline usec_t service_timeout_abort_usec(Service *s) {
return s->timeout_abort_set ? s->timeout_abort_usec : s->timeout_stop_usec;
}
+static inline NotifyAccess service_get_notify_access(Service *s) {
+ assert(s);
+ return s->notify_access_override < 0 ? s->notify_access : s->notify_access_override;
+}
+
static inline usec_t service_get_watchdog_usec(Service *s) {
assert(s);
return s->watchdog_override_enable ? s->watchdog_override_usec : s->watchdog_original_usec;