To support self-restarting services, winsw exposes WINSW_EXECUTABLE
environment variable into the forked process,
which refers to the full path of WinSW.exe that's managing the service.
To restart the service from within, execute %WINSW_EXECUTABLE% restart!
.
Note that you are invoking restart!
command, not restart
command.
This hidden command is a flavor of the restart
operation,
where winsw creates another winsw process in a separate process group,
and restarts the service from there.
This additional indirection is necessary because WinSW will kill child processes recursively when it stops a service. Windows Service Control Manager (SCM) doesn't provide the restart operation as an atomic operation either, so winsw implements restart by a sequence of stop and start. The second winsw process in a separate process group ensures that winsw can survive this massacre to execute the start call.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。