• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

Bug PID file or better signal handling (for Supervisor compatibility)

Status
Not open for further replies.
I just updated from SinusBot 0.9.8 to 0.9.12.3-36fce3c, on a VPS running Ubuntu Server 14.04 LTS x64.
I noticed that, unlike the old version, when I start it two "sinusbot" processes get executed.
I am using Supervisor to manage the process, and when I request to terminate it, it sends a SIGTERM to the first process, the one it started: the other one is still running and the bot still works fine. You can test this by manually killing the first process.
There are two solutions that will allow Supervisor (and similar process managers) to work fine: either you can handle the SIGTERM on the first process killing the second one too, or you can write the PID of the second process to a file, so it can be killed afterwards (I tested that manually killing the second process works fine, the first one stops too).
You can read about how Supervisor handles subprocesses here, but I'm sure other process managers and init-files would benefit from this.
Is it possible to implement any of these solutions, or as a workaround add a config option to disable the forking?
 

flyth

is reticulating splines
Staff member
Developer
Contributor
How do you run the bot? I don't remember putting any forks in there.
 
Just to make sure it was not Supervisor's fault, I tried running it like this:
Code:
su ts3bot
./sinusbot
And it still shows two processes running:
Code:
ps ax | grep sinusbot
20121 pts/0    S      0:00 ./sinusbot
20122 pts/0    Sl     0:00 ./sinusbot
 
Status
Not open for further replies.
Top