From c870dcaa53988f709b1152221e76992972365fb5 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Wed, 23 May 2018 08:23:08 +0300 Subject: 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 --- dh_runit | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'dh_runit') 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}}) { "/var/lib/runit/supervise/$name", $tmp); install_dir("$tmp/var/lib/runit/supervise/$name"); - if ($conf->{enable}) { - make_symlink("/etc/runit/runsvdir/default/$name", - "/etc/sv/$name", $tmp); - } - runit_autoscript($pkg, 'postrm', "s/#NAME#/$name/"); + my $substitutions = { + NAME => $name, + ENABLE => $conf->{enable} ? "yes" : "no" + }; + + runit_autoscript($pkg, 'postrm', $substitutions); + runit_autoscript($pkg, 'postinst', $substitutions); + if ($conf->{logscript}) { my $logdir = "/var/log/runit/$name"; @@ -100,7 +103,7 @@ HERE } } addsubstvar($pkg, 'misc:Depends', 'runit', '>= 2.1.2-7'); - addsubstvar($pkg, 'misc:Depends', 'runit-helper'); + addsubstvar($pkg, 'misc:Depends', 'runit-helper', '>= 2.7.3'); } # PROMISE: DH NOOP WITHOUT runit @@ -184,3 +187,5 @@ This section contains several example snippets from F.runit> path/to/directory name=my-preferred-name,logscript =cut + +# vim: et:sw=4 -- cgit v1.2.3