summaryrefslogtreecommitdiff
path: root/postinst-runit
blob: 3a518325582352f8623908c7de69c1656a6da508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SV_ABS_DIR=/var/lib/runit/service
SV_DIR=/etc/service
mkdir -p "$SV_ABS_DIR"
if [ ! -e "$SV_DIR" ] ; then
    ln -s "$SV_ABS_DIR" "$SV_DIR"
fi

if [ "$(readlink -f "$SV_DIR")" != "$SV_ABS_DIR" ] ; then
    cat <<EOF
Service directory '$SV_DIR' exists, but is not symbolic link
to '$SV_ABS_DIR'. It probably means that it was created by
hand or versions of runit below 2.1.2-4.

In either case, please remove service directory yourself and
restart installation.
EOF
    exit 1
fi
NAME=#NAME#
ln -s "/etc/sv/$NAME" "$SV_DIR/$NAME"