aboutsummaryrefslogtreecommitdiffstats
path: root/testing/socklog
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
parent71d213b231cfbb03b854d7d900d1e75402f90f73 (diff)
downloadaports-711b6bbfddf7901293721b8e62ae80b86440022e.tar.bz2
aports-711b6bbfddf7901293721b8e62ae80b86440022e.tar.xz
testing/socklog: add post-install script
This sets up logging with runit (tested with logs from tinyssh).
Diffstat (limited to 'testing/socklog')
-rw-r--r--testing/socklog/APKBUILD2
-rw-r--r--testing/socklog/socklog.post-install21
2 files changed, 22 insertions, 1 deletions
diff --git a/testing/socklog/APKBUILD b/testing/socklog/APKBUILD
index 66706ea6e9..708035ae9f 100644
--- a/testing/socklog/APKBUILD
+++ b/testing/socklog/APKBUILD
@@ -7,7 +7,7 @@ pkgdesc="System and kernel logging services for runit"
url="http://smarden.org/socklog/"
arch="all"
license="BSD"
-makedepends="$depends_dev"
+install="$pkgname.post-install"
subpackages="$pkgname-doc"
source="http://smarden.org/$pkgname/$pkgname-$pkgver.tar.gz"
diff --git a/testing/socklog/socklog.post-install b/testing/socklog/socklog.post-install
new file mode 100644
index 0000000000..9cfa37f90e
--- /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
+