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