summaryrefslogtreecommitdiff
path: root/src/hls/create-runit-conf.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2012-10-20 19:14:56 +0200
committerChristian Pointner <equinox@spreadspace.org>2012-10-20 19:14:56 +0200
commitd0a508929374879a814468abc4747883f7d96546 (patch)
tree45b853a8d3a2755bffa40bc930f6fe86efdb49db /src/hls/create-runit-conf.sh
parentadded elevate0 (diff)
added hls handlers
Diffstat (limited to 'src/hls/create-runit-conf.sh')
-rwxr-xr-xsrc/hls/create-runit-conf.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/hls/create-runit-conf.sh b/src/hls/create-runit-conf.sh
new file mode 100755
index 0000000..4d43282
--- /dev/null
+++ b/src/hls/create-runit-conf.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage $0 <name>"
+ exit 1
+fi
+
+name=$1
+OUT_D=runit
+
+rm -rf "$OUT_D"
+mkdir -p "$OUT_D"
+
+for src in av-orig av-en; do
+ for profile in low medium high; do
+ echo "creating runit instance for $src - $profile"
+ DIR="$OUT_D/hls-$name-$src-$profile"
+ mkdir -p "$DIR/log"
+cat >> "$DIR/run" <<EOF
+#!/bin/sh
+set -e
+
+exec 2>&1
+exec chpst -u flumotion:flumotion /usr/local/bin/start-hls.sh "$name" "$src" "$profile"
+EOF
+ chmod +x "$DIR/run"
+
+cat >> "$DIR/log/run" <<EOF
+#!/bin/sh
+set -e
+
+LOG_D="/var/log/hls-$name/$src-$profile/"
+if [ ! -d "\$LOG_D" ]; then
+ mkdir -p -m0750 "\$LOG_D"
+fi
+chown root:adm "\$LOG_D"
+exec chpst -u root:adm svlogd -tt "\$LOG_D"
+EOF
+ chmod +x "$DIR/log/run"
+
+ ln -s "/var/run/sv.hls-$name-$src-$profile" "$DIR/supervise"
+ ln -s "/var/run/sv.hls-$name-$src-$profile.log" "$DIR/log/supervise"
+
+ done
+done