aboutsummaryrefslogtreecommitdiffstats
path: root/testing/socklog/socklog.post-install
blob: 3f1b8a31dd73099481e483a6c8a45ebeb3f7e430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 -g log 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