You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary. The stop and restart commands provided by WinSW do not properly terminate the existing Nginx process. This leads to the creation of multiple Nginx processes upon executing a restart command, as the old process does not shut down. The issue is further confirmed by the tasklist output which shows multiple instances of nginx.exe after a restart, and the expected single process after using taskkill and then starting the service.
Steps to reproduce
Start Nginx with WinSW using the E:\nginx-1.18.0\nginx-service.xml configuration.
Perform changes to the Nginx configuration files.
Use the restart command provided by WinSW to apply the changes and restart the service.
Notice that the previous Nginx process does not terminate, resulting in multiple Nginx processes running simultaneously.
Environment
WinSW version: 2.12.00
WinSW package type: WinSW-x64.exe
Windows version: Windows Server 2008 R2 Enterprise
Wrapped executable and version: Nginx 1.18.0
<!-- E:\nginx-1.18.0\nginx-service.xml -->
<service>
<id>nginx</id>
<name>nginx</name>
<description>This is an Nginx service managed by WinSW.</description>
<logpath>E:\nginx-1.18.0\logs\</logpath>
<logmode>roll</logmode>
<executable>E:\nginx-1.18.0\nginx.exe</executable>
<stopexecutable>E:\nginx-1.18.0\nginx.exe -s stop</stopexecutable>
</service>
Workaround and Issue Reporting Reason
The current workaround involves using taskkill /F /IM nginx.exe to forcefully terminate all instances of nginx.exe before starting the service again with nginx-service.exe start. However, this is not the best practice and can lead to data loss or corruption of the Nginx state. This behavior necessitates the reporting of this issue to seek a more graceful and reliable solution.
Command Output
E:\nginx-1.18.0>tasklist /fi "imagename eq nginx.exe"
信息: 没有运行的任务匹配指定标准。
E:\nginx-1.18.0>nginx-service.exe status
Stopped
E:\nginx-1.18.0>sc query nginx
SERVICE_NAME: nginx
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
E:\nginx-1.18.0>nginx-service.exe start
2024-01-15 16:58:38,252 INFO - Starting service 'nginx (nginx)'...
2024-01-15 16:58:38,908 INFO - Service 'nginx (nginx)' started successfully.
E:\nginx-1.18.0>tasklist /fi "imagename eq nginx.exe"
映像名称 PID 会话名 会话# 内存使用
========================= =================================== ============
nginx.exe 1988 Services 0 6,692 K
nginx.exe 1716 Services 0 6,988 K
E:\nginx-1.18.0>sc query nginx
SERVICE_NAME: nginx
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
E:\nginx-1.18.0>nginx-service.exe restart
2024-01-15 16:59:38,666 INFO - Stopping service 'nginx (nginx)'...
2024-01-15 16:59:38,944 INFO - Starting service 'nginx (nginx)'...
2024-01-15 16:59:40,118 INFO - Service 'nginx (nginx)' restarted successfully.
E:\nginx-1.18.0>tasklist /fi "imagename eq nginx.exe"
映像名称 PID 会话名 会话# 内存使用
========================= =================================== ============
nginx.exe 1716 Services 0 6,968 K
nginx.exe 10416 Services 0 6,692 K
nginx.exe 6728 Services 0 6,984 K
E:\nginx-1.18.0>:: why have three process, here?
Workaround and Issue Reporting Reason
The current workaround involves using taskkill /F /IM nginx.exe to forcefully terminate all instances of nginx.exe before starting the service again with nginx-service.exe start. However, this is not the best practice and can lead to data loss or corruption of the Nginx state. This behavior necessitates the reporting of this issue to seek a more graceful and reliable solution.
E:\nginx-1.18.0>taskkill /F /IM nginx.exe
成功: 已终止进程 "nginx.exe",其 PID 为 1716。
成功: 已终止进程 "nginx.exe",其 PID 为 10416。
成功: 已终止进程 "nginx.exe",其 PID 为 6728。
E:\nginx-1.18.0>nginx-service.exe start
2024-01-15 17:03:59,517 INFO - Starting service 'nginx (nginx)'...
2024-01-15 17:04:00,165 INFO - Service 'nginx (nginx)' started successfully.
E:\nginx-1.18.0>tasklist /fi "imagename eq nginx.exe"
映像名称 PID 会话名 会话# 内存使用
========================= =================================== ============
nginx.exe 8128 Services 0 6,692 K
nginx.exe 1076 Services 0 6,988 K
E:\nginx-1.18.0>
Additional Information
I'm willing to provide further details like logs or any other information that may be missing from this report. Thank you to all the coders who take the time to look into this issue.
The text was updated successfully, but these errors were encountered:
Summary. The
stop
andrestart
commands provided by WinSW do not properly terminate the existing Nginx process. This leads to the creation of multiple Nginx processes upon executing arestart
command, as the old process does not shut down. The issue is further confirmed by thetasklist
output which shows multiple instances ofnginx.exe
after a restart, and the expected single process after usingtaskkill
and then starting the service.Steps to reproduce
E:\nginx-1.18.0\nginx-service.xml
configuration.restart
command provided by WinSW to apply the changes and restart the service.Environment
Workaround and Issue Reporting Reason
The current workaround involves using
taskkill /F /IM nginx.exe
to forcefully terminate all instances ofnginx.exe
before starting the service again withnginx-service.exe start
. However, this is not the best practice and can lead to data loss or corruption of the Nginx state. This behavior necessitates the reporting of this issue to seek a more graceful and reliable solution.Command Output
Workaround and Issue Reporting Reason
The current workaround involves using
taskkill /F /IM nginx.exe
to forcefully terminate all instances ofnginx.exe
before starting the service again withnginx-service.exe start
. However, this is not the best practice and can lead to data loss or corruption of the Nginx state. This behavior necessitates the reporting of this issue to seek a more graceful and reliable solution.Additional Information
I'm willing to provide further details like logs or any other information that may be missing from this report. Thank you to all the coders who take the time to look into this issue.
The text was updated successfully, but these errors were encountered: