summaryrefslogtreecommitdiff
path: root/runit-helper
diff options
context:
space:
mode:
authorDmitry Bogatov <KAction@gnu.org>2018-05-23 08:23:08 +0300
committerDmitry Bogatov <KAction@gnu.org>2018-05-27 11:13:01 +0300
commitc870dcaa53988f709b1152221e76992972365fb5 (patch)
treefc056e71e6208daeb60335d9f0d543674f34887e /runit-helper
parent9376da82f5ae0b68c361c314b8af09ab56229671 (diff)
Do not re-enable serice on upgrade
* Do not make symbolic link /etc/runit/runsvdir/default/$name -> /etc/sv/$name part of package files {in which case it will be unconditionally created on upgrade}; instead manage it in maintainer scripts: create it in postinst script on fresh install and remove on purge/remove in postrm. * Force versioned dependency on runit-helper, to make sure that versioned dependency on dh-runit would close #899242
Diffstat (limited to 'runit-helper')
-rwxr-xr-xrunit-helper23
1 files changed, 19 insertions, 4 deletions
diff --git a/runit-helper b/runit-helper
index e48020b..05724af 100755
--- a/runit-helper
+++ b/runit-helper
@@ -18,7 +18,25 @@
18 18
19set -e 19set -e
20 20
21postinst () {
22 local action="${1}" previous="${2:-}"
23
24 # Fresh installation (not upgrade). It is important to not override
25 # local admin decision (see #899242).
26 if [ "${ENABLE}" = yes ] && [ -z "${previous}" ] ; then
27 ln -sf "/etc/sv/$NAME" "/etc/runit/runsvdir/default/$NAME"
28 fi
29}
30
21postrm () { 31postrm () {
32 local action="${1}"
33
34 if [ "${action}" != 'purge' ] && [ "${action}" != 'remove' ] ; then
35 return
36 fi
37
38 # Links in other runsvdirs is responsibility of administrator.
39 rm -f "/etc/runit/runsvdir/default/$NAME"
22 40
23 # Following code makes sure, that after removal of package, in default 41 # Following code makes sure, that after removal of package, in default
24 # setup, the only files belonged to log user, belong to root. 42 # setup, the only files belonged to log user, belong to root.
@@ -33,10 +51,6 @@ postrm () {
33 chown --recursive root:root "/var/log/runit/$NAME" 51 chown --recursive root:root "/var/log/runit/$NAME"
34 fi 52 fi
35 53
36 if [ "$1" != 'purge' ] ; then
37 return
38 fi
39
40 # If runscript was never invoked, there will be no files 54 # If runscript was never invoked, there will be no files
41 # in this directory, and `dpkg' will remove it. In this case, 55 # in this directory, and `dpkg' will remove it. In this case,
42 # we have nothing to do. 56 # we have nothing to do.
@@ -64,3 +78,4 @@ postrm () {
64} 78}
65 79
66"$@" 80"$@"
81# vim: sw=4:et