From fc35408ab60287a4e978ba93e61c2ded44342e7d Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Thu, 9 Jun 2016 18:50:22 +0300 Subject: 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' --- postrm-runit | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 postrm-runit (limited to 'postrm-runit') diff --git a/postrm-runit b/postrm-runit new file mode 100644 index 0000000..9556830 --- /dev/null +++ b/postrm-runit @@ -0,0 +1,12 @@ +#!/bin/sh # just to convince emacs that it is shell script + +if [ "$1" = 'purge' ] ; then + # If runscript was never invoked, these files would not exist, + # so we use -f option of rm(1). + for file in control lock ok pid stat status ; do + rm -f "/var/lib/runit/supervise/#NAME#/$file" + done + # It should exist and be empty now. If it is not, either user touched it, + # or there is a BUG in dh-runit! + rmdir "/var/lib/runit/supervise/#NAME#" +fi -- cgit v1.2.3