diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-01-28 03:23:04 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-01-28 03:23:04 -0300 |
commit | 4fd38b1c7635719535ed16a2ed7cf6814ded90f8 (patch) | |
tree | 5a3adb6091fae6f777c4654663018715d04ab789 /pkgs/varnish/varnish.runit | |
parent | 21c6105c4fdacb617bd6a1cc06222f1de93be47e (diff) |
Diffstat (limited to 'pkgs/varnish/varnish.runit')
-rwxr-xr-x | pkgs/varnish/varnish.runit | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/varnish/varnish.runit b/pkgs/varnish/varnish.runit new file mode 100755 index 0000000..e9e647f --- /dev/null +++ b/pkgs/varnish/varnish.runit @@ -0,0 +1,28 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +. /etc/varnish.conf + +BIN="/usr/sbin/varnishd" + +PID=`pidof %PPID $BIN` + +killjobs () { + kill $PID >&/dev/null +} + +trap killjobs INT QUIT TERM EXIT KILL HUP + +if [ -z "$PID" ] +then + $BIN $OPTS +else + for P in $PID + do + watchpid $P & + done +fi +wait |