tmds / Tmds.Systemd

.NET Core library for interacting with systemd
Other
128 stars 17 forks source link

Provide a way to detect if we are running as part of systemd #27

Closed tmds closed 6 years ago

tmds commented 6 years ago

API:

class ServiceManager
{
   bool IsRunningAsService { get; }
}

Implementation: INVOCATION_ID environment variable is set.

tmds commented 6 years ago

Implemented in https://github.com/tmds/Tmds.Systemd/pull/30