This is not nice atm, but worked for us once, via s6 supervizor.
I'm not sure what's the best solution, e.g. how to integrate uwsgi and raven to log harakiri.
/etc/s6/uwsgi_harakiri/harakiri_service
#!/bin/sh
trap 'echo parent shutting down; pid=$(jobs -p); [ "$pid" ] && kill $pid' EXIT
tail -f /var/log/uwsgi/hostname.log | gawk \
'{ if (match($0, /\*\*\* HARAKIRI ON WORKER ([0-9]+) \(pid: ([0-9]+), try: 1\) \*\*\*/, a))
{ system( "gawk \"BEGIN {print \\\"Subject: Harakiri on hostname\\n\\\"} /\\*\\*\\* HARAKIRI ON WORKER " a[1] " \\(pid: " a[2] ", try: 1\\) \\*\\*\\*/ {flag=1} /died, killed by signal 9 :\\( trying respawn/ {flag=0} flag\" /var/log/uwsgi/hostname.log | /path_to_virtualenv_with_ravenharakiri/bin/raven-harakiri --dsn=HEREGOESYOURDSN" ) } }'
/etc/s6/uwsgi_harakiri/run
#!/usr/local/execline/bin/execlineb -P
/usr/local/execline/bin/fdmove -c 2 1
s6-setuidgid uwsgi
./harakiri_service
/etc/s6/uwsgi_harakiri/log/run
#!/usr/local/execline/bin/execlineb -P
s6-setuidgid uwsgi
s6-log -t s1000000 n20 /var/log/uwsgi/harakiri-service
This is not nice atm, but worked for us once, via s6 supervizor.
I'm not sure what's the best solution, e.g. how to integrate uwsgi and raven to log harakiri.
/etc/s6/uwsgi_harakiri/harakiri_service
/etc/s6/uwsgi_harakiri/run
#!/usr/local/execline/bin/execlineb -P /usr/local/execline/bin/fdmove -c 2 1 s6-setuidgid uwsgi ./harakiri_service/etc/s6/uwsgi_harakiri/log/run