Username: Password:

Author Topic: feature request: reload config on SIGHUP / CONFIG_FS_WATCH:false  (Read 19138 times)

Offline someone111

  • Rookie
  • *
  • Posts: 10
    • View Profile
I am running many instances of gunbot to have gunbot work with many currency pairs. The config files are just copies with different names for different pairs.

When I change a value in all config files at once (using sed or so), I am running out of RAM on my VPS. This is because during automatic config reload by gunbot, it will require more RAM. This could get one or another gunbot killed by the kernel or wreck the whole system.

It is also very usual for a linux daemon to automatically reload its config if the config file changed on the disk. Perhaps I was just saving my temporary progress and did not want to apply that config yet. I understand that you implemented this to better suit Windows users.

It's not great, so I cannot test my changes locally using git and then git fetch the repository on the remote. I had to write a script that slowly copies and wasted one config after another.

Could you please kindly add the following config option as a new feature?

Code: [Select]
CONFIG_FS_WATCH:true, // When true (default), automatically reload config when config file was changed on disk.

And second, could you please make gunbot to reload it's config when it receives signal SIGHUP?

The way to send SIGHUP so the daemon reloads its config on linux is. Note: No, this does NOT kill the process.

Code: [Select]
kill -HUP <processID>

Since many might not know this... A few more examples on the usage of the kill command on linux.

To politely ask a process to properly shut down and terminate, one would use sigterm.

Code: [Select]
kill -sigterm <processID>

To immediately kill a process without giving it proper notice or any chance to properly shut down (useful in case the process did not shutdown using sigterm or hangs).

Code: [Select]
kill -sigkill <processID>

Could you pleases implement CONFIG_FS_WATCH:true/false and SIGHUP support?