diff options
author | Franck Bui <fbui@suse.com> | 2018-05-30 17:57:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-06-13 18:52:27 +0200 |
commit | a6ecbf836c1e70cdf05a1ad6b78c86c5aef4dca3 (patch) | |
tree | 291745679323a6cf89cd4f4045d62aae8688394b /src/core/manager.h | |
parent | networkd: Don't try to close fd in sd_radv_stop if fd is closed. (diff) | |
download | systemd-a6ecbf836c1e70cdf05a1ad6b78c86c5aef4dca3.tar.xz systemd-a6ecbf836c1e70cdf05a1ad6b78c86c5aef4dca3.zip |
pid1: preserve current value of log level across re-{load,execution}
To make debugging easier, this patches allows one to change the log level and
do reload/reexec without modifying configuration permanently, which makes
debugging easier.
Indeed if one changed the log max level at runtime (via the bus or via
signals), the change was lost on the next daemon reload/reexecution.
In order to restore the original value back (set via system.conf, environment
variables or any other means), the empty string in the "LogLevel" property is
now supported as well as sending SIGRTMIN+23 signal.
Diffstat (limited to '')
-rw-r--r-- | src/core/manager.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/manager.h b/src/core/manager.h index 8868e9c158..fb28316b8e 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -302,6 +302,9 @@ struct Manager { uint64_t default_tasks_max; usec_t default_timer_accuracy_usec; + int original_log_level; + bool log_level_overridden:1; + struct rlimit *rlimit[_RLIMIT_MAX]; /* non-zero if we are reloading or reexecuting, */ @@ -465,6 +468,9 @@ char *manager_taint_string(Manager *m); void manager_ref_console(Manager *m); void manager_unref_console(Manager *m); +void manager_override_log_level(Manager *m, int level); +void manager_restore_original_log_level(Manager *m); + const char *manager_state_to_string(ManagerState m) _const_; ManagerState manager_state_from_string(const char *s) _pure_; |