Systemd Socket Activation
This commit is contained in:
parent
99202af871
commit
3a30daf597
1 changed files with 12 additions and 1 deletions
|
|
@ -65,10 +65,21 @@ builder.WebHost.ConfigureKestrel((context, options) =>
|
|||
var path = PathEx.ExpandPath(pdnsOptions.Socket);
|
||||
FileInfo file = new(path);
|
||||
file.Directory!.Create();
|
||||
options.ListenUnixSocket(path, options =>
|
||||
bool isSystemd = false;
|
||||
options.UseSystemd(options =>
|
||||
{
|
||||
isSystemd = true;
|
||||
options.UseConnectionHandler<PowerDnsHandler>();
|
||||
});
|
||||
|
||||
if (!isSystemd)
|
||||
{
|
||||
file.Delete();
|
||||
options.ListenUnixSocket(path, options =>
|
||||
{
|
||||
options.UseConnectionHandler<PowerDnsHandler>();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue