possible to transform signals sent by s6-svc?

From: Brett Neumeier <bneumeier_at_gmail.com>
Date: Fri, 14 Oct 2016 15:47:47 -0500

I'm starting to use s6 to manage long-running processes on my servers -- so
far, with great success. One of these services is PostgreSQL.

PostgreSQL can be terminated gracefully by sending it SIGTERM, SIGINT, or
SIGQUIT. Each is handled differently: with TERM, the server waits for all
sessions to disconnect before it shuts down the database; with INT, it
forcefully disconnects all current sessions and then shuts down the
database; and with QUIT, it terminates the database without doing a
checkpoint and graceful shutdown at all.

So what I'd like to do is have "s6-svc -d" result in the process receiving
SIGINT and SIGCONT to the supervised process, rather than SIGTERM and

It doesn't seem like there's a way to do this. Or am I missing something?
It looks like there is a mechanism to do that kind of signal remapping in
s6-svscan, using the -s option, but the documentation for servicedirs
doesn't mention anything like that.

If I'm right and there's no easy way to do that, it's not necessarily a
huge problem -- currently I'm just using "s6-svc -iO" to shut down
PostgreSQL, and I can keep doing that; or, alternatively, I can patch
PostgreSQL to switch the behavior of TERM and INT. But if there *is* a way
to get s6-svc to behave differently, I'm interested!



Brett Neumeier (bneumeier_at_gmail.com)
Received on Fri Oct 14 2016 - 20:47:47 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC