postgresql-signal-wrapper 243 Bytes
Newer Older
Jacob Vosmaer's avatar
Jacob Vosmaer committed
1
#!/usr/bin/env ruby
2 3 4
#
# Translate SIGTERM to SIGINT to request a 'fast shutdown' from Postgres.

5 6 7 8
Signal.trap('TERM') do
  puts "Sending INT to #{$pid}"
  Process.kill('INT', $pid)
end
Jacob Vosmaer's avatar
Jacob Vosmaer committed
9 10 11 12

$pid = spawn(*ARGV)
Process.wait($pid)
exit $?.exitstatus