• Stopping SRCDS on SIGTERM
    3 replies, posted
Are there any options / patches / wrappers etc. that can make SRCDS cleanly shutdown (as if typing "quit" or "exit" at the server prompt) when sent a SIGTERM signal? I'm running SRCDS in Docker which tries to send a SIGTERM to cleanly quit programs, but since SRCDS doesn't respond to this it ends up timing out and then forcibly killing the process every time.
i can only suggest 2 solutions, none of which are simple. Launch your SRCDS from some sort of environment that can trap signals (e.g. a language such as Python or Ruby), then when a signal is received, send "quit" to Garry's Mods' STDIN. Create a binary module for Garry's Mod that adds a function that lets you catch specific signals.
Alright, the first options sounds within my ability. Has no one made either of these before though? There's no point reinventing the wheel if someone else has probably already done it better. I can't imagine that making SRCDS respond to a signal that every other program on the system responds to is a super niche requirement that only I have.
I posted a question on Stack Exchange and found a solution to this problem. Using the program "expect" you can make a small wrapper script that sends commands to SRCDS. See here.
Sorry, you need to Log In to post a reply to this thread.