script-server
script-server copied to clipboard
Restart server ??
Maybe a stupid question, but how in easy way restart server ? The best option would be restart option from server itself... Right now i have to run specific action in task scheduler in Synology ( script-server is running on Synology); pkill -f "python3 ./launcher.py" python3 ./launcher.py I tried to add such script in script-server but its not working (which is obvious , if you kill launcher, it wont trigger to run next instance) Is there any better trick, or im missing something?
Services that restart themselves generally fork a controller process to:
- Stop the original process
- Start a new one
The other option is to put it under the control of your OS's native process manager (i.e., systemd in modern Linuxes)
In theory, something like this would simulate the first option from within script-server itself:
at now << xxEOFxx pkill -f "python3 ./launcher.py" python3 ./launcher.py xxEOFxx
This would put the actual control of the restart outside of the soon-to-be-dead script-server, but would depend on script-server's user having access to run commands via cron/at, and access to manage its own process.
unfortunately, there is no at command on synology box
Hi @kodifan, I'm not aware of any ways to solve this problem, unfortunately.
By the way, what are the reasons for the server restart?
actually , its a script server itself. A lot of not yet implemented or not fully implemented options requires restart of server. And to be honest, most of apps that I use have such option avalible in UI
ps. I just think about it, and it doesn't need to be physical restart of launcher.py, i think just full reload of all configs and scripts will be enough.
Maybe a stupid question, but how in easy way restart server ? The best option would be restart option from server itself... Right now i have to run specific action in task scheduler in Synology ( script-server is running on Synology); pkill -f "python3 ./launcher.py" python3 ./launcher.py I tried to add such script in script-server but its not working (which is obvious , if you kill launcher, it wont trigger to run next instance) Is there any better trick, or im missing something?
You probably want something like having the process (re)started/managed by an process/service manager. Either you use systemd like mentioned by @MNeill73 in https://github.com/bugy/script-server/issues/666#issuecomment-1529699384 or use the container version of script-server which manages the process inside the container and then just restart the container.