diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-19 21:58:36 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-20 12:49:52 +0400 |
| commit | 6ba24e341fd1e0a8b387c705ce34cc3f19dcf375 (patch) | |
| tree | 8221628f1e1393052940b72f24d220a666c1dc2b /src/main.rs | |
| parent | 13b6c74cc376c0ddff6d83f713cd32aa07a89fd7 (diff) | |
| download | niri-6ba24e341fd1e0a8b387c705ce34cc3f19dcf375.tar.gz niri-6ba24e341fd1e0a8b387c705ce34cc3f19dcf375.tar.bz2 niri-6ba24e341fd1e0a8b387c705ce34cc3f19dcf375.zip | |
utils/spawn: Put processes into systemd scopes
This separates them from the niri scope for the purposes of e.g. the OOM
killer only killing the app and not the compositor.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index bcf0feae..632de774 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,8 @@ use niri::dbus; use niri::ipc::client::handle_msg; use niri::niri::State; use niri::utils::{ - cause_panic, spawn, version, REMOVE_ENV_RUST_BACKTRACE, REMOVE_ENV_RUST_LIB_BACKTRACE, + cause_panic, spawn, version, IS_SYSTEMD_SERVICE, REMOVE_ENV_RUST_BACKTRACE, + REMOVE_ENV_RUST_LIB_BACKTRACE, }; use niri::watcher::Watcher; use niri_config::Config; @@ -38,6 +39,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { } let is_systemd_service = env::var_os("NOTIFY_SOCKET").is_some(); + IS_SYSTEMD_SERVICE.store(is_systemd_service, Ordering::Relaxed); let directives = env::var("RUST_LOG").unwrap_or_else(|_| "niri=debug".to_owned()); let env_filter = EnvFilter::builder().parse_lossy(directives); |
