aboutsummaryrefslogtreecommitdiffstats
path: root/testing/socklog/socklog.post-install
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2015-07-15 16:53:22 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2015-07-16 13:44:00 +0000
commit711b6bbfddf7901293721b8e62ae80b86440022e (patch)
tree59f26d557f4e9f602d8d4e86e80f47b144a11d6f /testing/socklog/socklog.post-install
parent71d213b231cfbb03b854d7d900d1e75402f90f73 (diff)
testing/socklog: add post-install script
This sets up logging with runit (tested with logs from tinyssh).
Diffstat (limited to 'testing/socklog/socklog.post-install')
-rw-r--r--testing/socklog/socklog.post-install21
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/socklog/socklog.post-install b/testing/socklog/socklog.post-install
new file mode 100644
index 00000000000..9cfa37f90eb
--- /dev/null
+++ b/testing/socklog/socklog.post-install
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Alpine Linux post-install script for socklog
+# Copyright 2015 Stuart Cardall (developer@it-offshore.co.uk)
+# Distributed under the terms of the GNU General Public License, v2 or later #
+
+adduser -S -H -h /var/empty -D -s /sbin/nologin log 2>/dev/null
+if [ ! -d /etc/sv/socklog-unix ]; then
+ socklog-conf unix nobody log
+ mkdir -p /etc/service
+ ln -s /etc/sv/socklog-unix /etc/service/
+fi
+
+if [ ! -f /etc/sv/socklog-unix/run ]; then
+cat > /etc/sv/socklog-unix/run <<EOF
+#!/bin/sh
+/etc/init.d/syslog stop &>/dev/null
+exec 2>&1
+exec chpst -Unobody socklog unix /dev/log
+EOF
+fi
+