-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restart doesn't work from Docker on Synology DSM #494
Comments
After more extensive testing, it was discovered that the issue occurs when homebridge-openhab2-complete plugin is installed. Still, it should be possible at least to redefine restart command in the config file, that allows to resolve the issue. |
Can you see if this command works instead?
Just run it manually at the terminal. |
@oznu Actually, I have experimented with different commands already. killall does its job well, there is no need to lookup PID with pidof commmand. What makes the difference is the signal which we send to the process. SIGTERM (15) is the default signal that killall sends if signal is not specified explicitly. It allows the process to terminate gracefully closing all the open handles, connections, etc., while SIGKILL should be used as a solution of last resort to terminate hanged/unresponsive processes.
or your edition:
will result in the error in the log file if you don't run Config UI X. |
These commands are only issued if the user restarts from Homebridge Config UI X. From v4.8.1 SIGTERM will be sent to the Homebridge process first, followed by a SIGKILL after 5.1 seconds, which is normal circumstances won't do anything as Homebridge should kill itself 5 seconds after SIGTERM anyway. |
Describe The Bug:
Restart issues hardcoded command (homebridge-config-ui-x/src/core/config/config.service.ts method setConfigForDocker):
this.ui.restart = 'killall -9 homebridge && killall -9 homebridge-config-ui-x';
After killing those processes, tee processes are still alive, so s6-supervise still believes that homebridge service is alive and neither tries to restart it nor calls finish service script, so TERMINATE_ON_ERROR=1 also doesn't have any effect.
The issue could be fixed by the correct restart command, but its value in the config.js is ignored.
To Reproduce:
Run oznu/docker-homebridge container on Synology NAS and try to click "Restart" from the Config UI X. Although services are killed, s6-supervise doesn't detect termination.
After issuing
killall -9 tee
command s6-supervise correctly detects homebridge "service" termination.Expected behavior:
homebridge services stop correctly, s6-supervise detect termination, executes finish script and based on the TERMINATE_ON_ERROR value, finish script can stop the contain, or homebridge service is restarted.
Logs:
Homebridge Config:
Screenshots:
Environment:
The text was updated successfully, but these errors were encountered: