diff options
author | Dmitry Bogatov <KAction@gnu.org> | 2016-06-09 18:50:22 +0300 |
---|---|---|
committer | Dmitry Bogatov <KAction@gnu.org> | 2016-06-09 18:50:22 +0300 |
commit | fc35408ab60287a4e978ba93e61c2ded44342e7d (patch) | |
tree | 2d96b90cc3a03e1daeefb9d540046c6ae5efb634 /postrm-runit | |
parent | 9002e984d29480a3287506c73d82f247b0dbacea (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 'postrm-runit')
-rw-r--r-- | postrm-runit | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/postrm-runit b/postrm-runit new file mode 100644 index 0000000..9556830 --- /dev/null +++ b/postrm-runit | |||
@@ -0,0 +1,12 @@ | |||
1 | #!/bin/sh # just to convince emacs that it is shell script | ||
2 | |||
3 | if [ "$1" = 'purge' ] ; then | ||
4 | # If runscript was never invoked, these files would not exist, | ||
5 | # so we use -f option of rm(1). | ||
6 | for file in control lock ok pid stat status ; do | ||
7 | rm -f "/var/lib/runit/supervise/#NAME#/$file" | ||
8 | done | ||
9 | # It should exist and be empty now. If it is not, either user touched it, | ||
10 | # or there is a BUG in dh-runit! | ||
11 | rmdir "/var/lib/runit/supervise/#NAME#" | ||
12 | fi | ||