summaryrefslogtreecommitdiff
path: root/postinst-runit
diff options
context:
space:
mode:
authorDmitry Bogatov <KAction@gnu.org>2016-06-09 18:50:22 +0300
committerDmitry Bogatov <KAction@gnu.org>2016-06-09 18:50:22 +0300
commitfc35408ab60287a4e978ba93e61c2ded44342e7d (patch)
tree2d96b90cc3a03e1daeefb9d540046c6ae5efb634 /postinst-runit
parent9002e984d29480a3287506c73d82f247b0dbacea (diff)
Improve handling of maintainer scripts
* checking for /etc/service symlink is moved into preinst * runscripts are enabled in postinst * runscripts are disables in prerm * supervise directory is purged on 'postrm purge'
Diffstat (limited to 'postinst-runit')
-rw-r--r--postinst-runit19
1 files changed, 1 insertions, 18 deletions
diff --git a/postinst-runit b/postinst-runit
index 7c21f0e..1955857 100644
--- a/postinst-runit
+++ b/postinst-runit
@@ -1,20 +1,3 @@
1SV_ABS_DIR=/var/lib/runit/service
2SV_DIR=/etc/service 1SV_DIR=/etc/service
3mkdir -p "$SV_ABS_DIR"
4if [ ! -e "$SV_DIR" ] ; then
5 ln -s "$SV_ABS_DIR" "$SV_DIR"
6fi
7
8if [ "$(readlink -f "$SV_DIR")" != "$SV_ABS_DIR" ] ; then
9 cat <<EOF
10Service directory '$SV_DIR' exists, but is not symbolic link
11to '$SV_ABS_DIR'. It probably means that it was created by
12hand or versions of runit below 2.1.2-4.
13
14In either case, please remove service directory yourself and
15restart installation.
16EOF
17 exit 1
18fi
19ln -sf '/etc/sv/#NAME#' "$SV_DIR/" 2ln -sf '/etc/sv/#NAME#' "$SV_DIR/"
20mkdir -p /var/lib/runit/supervise/#NAME# 3mkdir -p '/var/lib/runit/supervise/#NAME#'