SystemdHostBuilderExtensions.AddSystemd(IServiceCollection) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Configures the lifetime of the IHost built from services
to
SystemdLifetime, provides notification messages for application started
and stopping, and configures console logging to the systemd format.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSystemd(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSystemd(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddSystemd : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddSystemd (services As IServiceCollection) As IServiceCollection
- services
- IServiceCollection
The IServiceCollection used to build the IHost. For example, Services or the IServiceCollection passed to the ConfigureServices(Action<HostBuilderContext,IServiceCollection>) callback.
The services
instance for chaining.
This is context aware and will only activate if it detects the process is running as a systemd Service.
The systemd service file must be configured with Type=notify
to enable notifications. See https://www.freedesktop.org/software/systemd/man/systemd.service.html.
Produk | Versi |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.1 (package-provided) |
.NET maklum balas
.NET ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas: