mirror of https://github.com/winsw/winsw
fix unhandled exception when signaling service stoped
parent
6cf303c1d3
commit
e7c869b9bd
|
@ -391,10 +391,14 @@ namespace WinSW
|
|||
|
||||
private void SignalStopped()
|
||||
{
|
||||
using var scm = ServiceManager.Open();
|
||||
using var sc = scm.OpenService(this.ServiceName, ServiceApis.ServiceAccess.QueryStatus);
|
||||
try {
|
||||
using var scm = ServiceManager.Open();
|
||||
using var sc = scm.OpenService(this.ServiceName, ServiceApis.ServiceAccess.QueryStatus);
|
||||
|
||||
sc.SetStatus(this.ServiceHandle, ServiceControllerStatus.Stopped);
|
||||
sc.SetStatus(this.ServiceHandle, ServiceControllerStatus.Stopped);
|
||||
} catch (Exception e) {
|
||||
Log.Error("Failed to signal service stopped status", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartProcess(Process processToStart, string arguments, string executable, LogHandler? logHandler)
|
||||
|
|
Loading…
Reference in New Issue