mirror of https://github.com/winsw/winsw
restart service revisited
git-svn-id: https://svn.kenai.com/svn/winsw~subversion/trunk@22 c8b2a3fe-9b5b-6a51-a37e-dc31b0e308faremotes/git-svn
parent
d42cf5188c
commit
cb3cff2dbe
16
Main.cs
16
Main.cs
|
@ -474,7 +474,8 @@ namespace winsw
|
||||||
}
|
}
|
||||||
|
|
||||||
StartProcess(stopProcess, stoparguments, executable);
|
StartProcess(stopProcess, stoparguments, executable);
|
||||||
stopProcess.WaitForExit();
|
// stopProcess.WaitForExit();
|
||||||
|
process.WaitForExit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,9 +612,18 @@ namespace winsw
|
||||||
}
|
}
|
||||||
if (args[0] == "restart")
|
if (args[0] == "restart")
|
||||||
{
|
{
|
||||||
if (s == null) ThrowNoSuchService();
|
if (s == null)
|
||||||
|
ThrowNoSuchService();
|
||||||
|
|
||||||
if(s.Started)
|
if(s.Started)
|
||||||
s.StopService();
|
s.StopService();
|
||||||
|
|
||||||
|
while (s.Started)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
s = svc.Select(d.Id);
|
||||||
|
}
|
||||||
|
|
||||||
s.StartService();
|
s.StartService();
|
||||||
}
|
}
|
||||||
if (args[0] == "status")
|
if (args[0] == "status")
|
||||||
|
|
Loading…
Reference in New Issue