Re: runit kill runsv

From: Avery Payne <avery.p.payne_at_gmail.com>
Date: Wed, 22 Jun 2016 15:08:46 +0000

>I am try to reproduce situation when runsv under some catastrophic
>failure,
>when runsv got killed, it will restart, but my test daemon "memcached"
>still running on background, eventually it will start memcached twice.
>How
>could I avoid this from happening? Seems fault handling isn't that
>great on
>this matter.
>
It almost sounds like you need to chain-load memcached using chpst. If
memcached has internal code to change its process group then it is
"escaping" supervision, which means that runsv is not in direct control
of it. To fix this, your ./run script would be similar to:

#!/bin/sh
exec 2>&1
exec chpst -P memcached

See http://smarden.org/runit/chpst.8.html for details. This would cause
memcached to be "captive" to the runsv process. Try the change with
chpst and see what happens. You may find other issues you're not seeing
after you make this change; check the log with tail -f /path/to/log/file
and see if it is restarting over and over (a "restart loop").
Received on Wed Jun 22 2016 - 15:08:46 UTC

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