summaryrefslogtreecommitdiff
path: root/postrm-runit
diff options
context:
space:
mode:
Diffstat (limited to 'postrm-runit')
-rw-r--r--postrm-runit12
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
3if [ "$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#"
12fi