共用方式為


SystemdHostBuilderExtensions.AddSystemd(IServiceCollection) 方法

定義

設定從 services 建置至 SystemdLifetimeIHost 存留期、提供應用程式啟動和停止的通知訊息,並將控制台記錄設定為 systemd 格式。

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 實例。

備註

這是內容感知,只有在偵測到進程以 systemd Service 執行時才會啟動。

系統服務檔案必須設定為 Type=notify,才能啟用通知。 請參閱 https://www.freedesktop.org/software/systemd/man/systemd.service.html

適用於