summaryrefslogtreecommitdiff
path: root/dh_runit
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 /dh_runit
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 'dh_runit')
-rwxr-xr-xdh_runit17
1 files changed, 11 insertions, 6 deletions
diff --git a/dh_runit b/dh_runit
index 36031ed..e0a8d7e 100755
--- a/dh_runit
+++ b/dh_runit
@@ -72,11 +72,14 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) {
72 "/var/lib/runit/supervise/$name", $tmp); 72 "/var/lib/runit/supervise/$name", $tmp);
73 install_dir("$tmp/var/lib/runit/supervise/$name"); 73 install_dir("$tmp/var/lib/runit/supervise/$name");
74 74
75 if ($conf->{enable}) { 75 my $substitutions = {
76 make_symlink("/etc/runit/runsvdir/default/$name", 76 NAME => $name,
77 "/etc/sv/$name", $tmp); 77 ENABLE => $conf->{enable} ? "yes" : "no"
78 } 78 };
79 runit_autoscript($pkg, 'postrm', "s/#NAME#/$name/"); 79
80 runit_autoscript($pkg, 'postrm', $substitutions);
81 runit_autoscript($pkg, 'postinst', $substitutions);
82
80 if ($conf->{logscript}) { 83 if ($conf->{logscript}) {
81 my $logdir = "/var/log/runit/$name"; 84 my $logdir = "/var/log/runit/$name";
82 85
@@ -100,7 +103,7 @@ HERE
100 } 103 }
101 } 104 }
102 addsubstvar($pkg, 'misc:Depends', 'runit', '>= 2.1.2-7'); 105 addsubstvar($pkg, 'misc:Depends', 'runit', '>= 2.1.2-7');
103 addsubstvar($pkg, 'misc:Depends', 'runit-helper'); 106 addsubstvar($pkg, 'misc:Depends', 'runit-helper', '>= 2.7.3');
104} 107}
105 108
106# PROMISE: DH NOOP WITHOUT runit 109# PROMISE: DH NOOP WITHOUT runit
@@ -184,3 +187,5 @@ This section contains several example snippets from F<I<package>.runit>
184 path/to/directory name=my-preferred-name,logscript 187 path/to/directory name=my-preferred-name,logscript
185 188
186=cut 189=cut
190
191# vim: et:sw=4