summaryrefslogtreecommitdiff
path: root/preinst-runit
diff options
context:
space:
mode:
Diffstat (limited to 'preinst-runit')
-rw-r--r--preinst-runit26
1 files changed, 14 insertions, 12 deletions
diff --git a/preinst-runit b/preinst-runit
index 19f959b..62feed4 100644
--- a/preinst-runit
+++ b/preinst-runit
@@ -1,20 +1,22 @@
1# -*- shell-script -*- 1# -*- shell-script -*-
2SV_ABS_DIR=/var/lib/runit/service 2SV_CURRENT=/etc/runit/runsvdir/current
3SV_DEFAULT=/etc/runit/runsvdir/default
3SV_DIR=/etc/service 4SV_DIR=/etc/service
4mkdir -p "$SV_ABS_DIR" 5
5if [ ! -e "$SV_DIR" ] ; then 6mkdir -p "$SV_DEFAULT"
6 ln -s "$SV_ABS_DIR" "$SV_DIR" 7if [ ! -e "$SV_CURRENT" ] ; then
8 ln -s default "$SV_CURRENT"
9elif [ ! -L "$SV_CURRENT" ] ; then
10 echo "unsupported: $SV_CURRENT exists, but is not symbolic link"
11 exit 1
7fi 12fi
8 13
9if [ "$(readlink -f "$SV_DIR")" != "$SV_ABS_DIR" ] ; then 14if [ ! -e "$SV_DIR" ] ; then
10 cat <<EOF 15 ln -sn "$SV_CURRENT" "$SV_DIR"
11Service directory '$SV_DIR' exists, but is not symbolic link 16fi
12to '$SV_ABS_DIR'. It probably means that it was created by
13hand or versions of runit below 2.1.2-4.
14 17
15In either case, please remove service directory yourself and 18if [ "$(readlink "$SV_DIR")" != "$SV_CURRENT" ] ; then
16restart installation. 19 echo "unsupported: $SV_DIR exists, but does not point to $SV_CURRENT"
17EOF
18 exit 1 20 exit 1
19fi 21fi
20 22