Mail archive
alpine-aports

[alpine-aports] [PATCH 3/3] testing/socklog: add post-install script

From: Stuart Cardall <developer_at_it-offshore.co.uk>
Date: Wed, 15 Jul 2015 16:53:22 +0000

This sets up logging with runit (tested with logs from tinyssh).
---
 testing/socklog/APKBUILD             |  2 +-
 testing/socklog/socklog.post-install | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 testing/socklog/socklog.post-install
diff --git a/testing/socklog/APKBUILD b/testing/socklog/APKBUILD
index 66706ea..708035a 100644
--- a/testing/socklog/APKBUILD
+++ b/testing/socklog/APKBUILD
_at_@ -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 0000000..9cfa37f
--- /dev/null
+++ b/testing/socklog/socklog.post-install
_at_@ -0,0 +1,21 @@
+#!/bin/sh
+# Alpine Linux post-install script for socklog
+# Copyright 2015 Stuart Cardall (developer_at_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
+
-- 
2.4.5
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Wed Jul 15 2015 - 16:53:22 GMT