Windows 11: mosquitto_signal config-reload returns success but config is not reloaded when broker runs as a service
##Title
Windows 11: mosquitto_signal config-reload returns success but configuration is not reloaded when broker runs as a service
Environment
OS: Windows 11 Pro
Mosquitto version: 2.1.2
Broker executable:
mosquitto_Test.exeConfiguration file:
C:\Program Files\mosquitto_Test\mosquitto.confmosquitto_signal.exefrom the same Mosquitto 2.1.2 installationTested with:
- native Mosquitto Windows service
- NSSM service wrapper
- normal/manual process start
Summary
mosquitto_signal.exe -p <PID> config-reload works correctly when Mosquitto is started as a normal process, but does not appear to reload the configuration when Mosquitto is running as a Windows service.
The command still returns exit code 0.
Working case
Start Mosquitto manually:
"C:\Program Files\mosquitto_Test\mosquitto_Test.exe" -c "C:\Program Files\mosquitto_Test\mosquitto.conf"Then get the broker PID and run:
mosquitto_signal.exe -p <PID> config-reloadResult:
- exit code is
0 - configuration changes are applied correctly
I verified this by changing a reloadable option such as:
log_timestamp_format %Y-%m-%d %H:%M:%Sto:
log_timestamp_format RELOADTEST-%Y-%m-%d %H:%M:%SAfter config-reload, new log entries use the changed format.
Failing case – native Windows service
The service is installed with:
"C:\Program Files\mosquitto_Test\mosquitto_Test.exe" installand runs as:
"C:\Program Files\mosquitto_Test\mosquitto_Test.exe" runThe correct Mosquitto PID is identified and the following command is sent:
mosquitto_signal.exe -p <actual Mosquitto PID> config-reloadResult:
- exit code is
0 - configuration changes are not applied
Failing case – NSSM
I also tested the broker through NSSM with the same command line that works manually:
"C:\Program Files\mosquitto_Test\mosquitto_Test.exe" -c "C:\Program Files\mosquitto_Test\mosquitto.conf"NSSM configuration:
Application:
C:\Program Files\mosquitto_Test\mosquitto_Test.exe
Arguments:
-c "C:\Program Files\mosquitto_Test\mosquitto.conf"
Startup directory:
C:\Program Files\mosquitto_TestThe actual child process mosquitto_Test.exe is identified, not the NSSM PID.
Then:
mosquitto_signal.exe -p <actual Mosquitto PID> config-reloadResult:
- exit code is
0 - configuration changes are not applied
Additional checks performed
I verified all of the following:
- The correct
mosquitto_Test.exePID is used. - The config file path is correct.
- The config file is valid:
mosquitto_Test.exe -c "C:\Program Files\mosquitto_Test\mosquitto.conf" --test-configreturns:
Configuration file is OK.and exit code 0.
- The service and reload script were also tested under Administrator privileges.
- The reload was also tested from Session 0.
mosquitto_signal.exestill returned exit code0.- The same executable and the same config file work correctly when started as a normal process outside the service environment.
Original use case
I originally discovered the problem while trying to rotate log files without restarting the broker.
For example, changing:
log_dest file C:\Program Files\mosquitto_Test\log1\mosquitto-2026-09-17.logto:
log_dest file C:\Program Files\mosquitto_Test\log1\mosquitto-2026-09-18.logand then sending:
mosquitto_signal.exe -p <PID> config-reloaddoes not switch the broker to the new log file when it is running as a Windows service.
After a full broker restart, the new log file is used correctly.
Expected behavior
When mosquitto_signal.exe -p <PID> config-reload returns success, reloadable configuration options should be re-read and applied, regardless of whether the broker is running interactively or as a Windows service.
Actual behavior
Source: eclipse-mosquitto/mosquitto