Add tip: approx with runit supervision
authorMichael Gebetsroither <michael.geb@gmx.at>
Fri, 26 Oct 2007 21:18:43 +0000 (21:18 +0000)
committerMichael Gebetsroither <michael.geb@gmx.at>
Fri, 26 Oct 2007 21:18:43 +0000 (21:18 +0000)
debian/changelog
grml_tips

index 821ce98..bfe87b2 100644 (file)
@@ -10,8 +10,9 @@ grml-tips (0.4.7) unstable; urgency=low
   [ Michael Gebetsroither ]
   * Added tips:
     - Configure a MadWifi device for adhoc mode
+    - approx with runit supervision
 
- -- Michael Gebetsroither <gebi@grml.org>  Tue, 02 Oct 2007 13:32:27 +0200
+ -- Michael Gebetsroither <michael.geb@gmx.at>  Fri, 26 Oct 2007 21:15:37 +0000
 
 grml-tips (0.4.6) unstable; urgency=low
 
index 636f6b2..f8db64c 100644 (file)
--- a/grml_tips
+++ b/grml_tips
@@ -3009,3 +3009,39 @@ Hints:
 Find dangling symlinks using zsh:
 
 % ls **/*(-@)
+-- 
+approx with runit supervision
+
+# apt-get install approx runit
+
+Add user approxlog for the logging daemon
+# adduser --system --home /nonexistent --no-create-home approxlog
+
+Create config directory
+# mkdir /etc/sv/approx
+
+Use /var/run/sv.approx as supervise directories
+# ln -s /var/run/sv.approx /etc/sv/approx/supervise
+
+# cat /etc/sv/approx/run
+# #!/bin/sh
+echo 'approx starting'
+exec approx -f 2>&1
+
+You normally do not need a logging service for approx, because it loggs
+to syslog too. So just for completion.
+# mkdir -p /etc/sv/approx/log
+# ln -s /var/run/sv.approx.log /etc/sv/approx/log/supervise
+# cat /etc/sv/approx/log/run
+#!/bin/sh
+set -e
+LOG="/var/log/approx"
+test -d "$LOG" || mkdir -p -m2750 "$LOG" && chown approxlog:adm "$LOG"
+exec chpst -uapproxlog svlogd -tt -v "$LOG"
+
+Now activate the new approx service (will be started within 5s)
+# ln -s /etc/sv/approx/ /var/service/
+
+Make the runit managed approx available with init-script interface.
+# dpkg-divert --local --rename /etc/init.d/approx
+# ln -s /usr/bin/sv /etc/init.d/approx