bugy / script-server

Web UI for your scripts with execution management
Other
1.52k stars 244 forks source link

Restart server ?? #666

Open kodifan opened 1 year ago

kodifan commented 1 year ago

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?

MNeill73 commented 1 year ago

Services that restart themselves generally fork a controller process to:

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.

kodifan commented 1 year ago

unfortunately, there is no at command on synology box

bugy commented 1 year ago

Hi @kodifan, I'm not aware of any ways to solve this problem, unfortunately.

bugy commented 1 year ago

By the way, what are the reasons for the server restart?

kodifan commented 1 year ago

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

kodifan commented 1 year ago

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.

treeol commented 4 months ago

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.