summaryrefslogtreecommitdiff
path: root/dh_runit
diff options
context:
space:
mode:
Diffstat (limited to 'dh_runit')
-rwxr-xr-xdh_runit18
1 files changed, 18 insertions, 0 deletions
diff --git a/dh_runit b/dh_runit
index 5ed55b5..4c9820e 100755
--- a/dh_runit
+++ b/dh_runit
@@ -5,6 +5,7 @@ use v5.10.1;
5use strict; 5use strict;
6use Debian::Debhelper::Dh_Lib; 6use Debian::Debhelper::Dh_Lib;
7use File::Find; 7use File::Find;
8use File::Path qw(make_path);
8use File::stat; 9use File::stat;
9use feature 'signatures'; 10use feature 'signatures';
10no warnings 'experimental'; 11no warnings 'experimental';
@@ -17,6 +18,7 @@ sub parse_options($opts) {
17 when (/^name=(.*)$/) { $conf->{name} = $1; }; 18 when (/^name=(.*)$/) { $conf->{name} = $1; };
18 when (/^since=(.*)$/) { $conf->{since} = $1; }; 19 when (/^since=(.*)$/) { $conf->{since} = $1; };
19 when (/^logscript$/) { $conf->{logscript} = 1}; 20 when (/^logscript$/) { $conf->{logscript} = 1};
21 when (/^noreplace$/) { $conf->{noreplace} = 1};
20 when (/^defaults$/) { "do nothing"; }; 22 when (/^defaults$/) { "do nothing"; };
21 default { error("unknown option `$opt'"); } 23 default { error("unknown option `$opt'"); }
22 } 24 }
@@ -59,6 +61,13 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) {
59 my $conf = parse_options($opts); 61 my $conf = parse_options($opts);
60 my $name = $conf->{name} || basename($path); 62 my $name = $conf->{name} || basename($path);
61 63
64 if ($conf->{noreplace}) {
65 make_path("${tmp}/var/lib/runit/noreplace/");
66 open(my $fh, ">", "${tmp}/var/lib/runit/noreplace/${name}")
67 || die $!;
68 close($fh);
69 }
70
62 if ( -f $path) { 71 if ( -f $path) {
63 install_dir("$sv_dir/$name"); 72 install_dir("$sv_dir/$name");
64 install_prog($path, "$sv_dir/$name/run"); 73 install_prog($path, "$sv_dir/$name/run");
@@ -182,6 +191,15 @@ version of package. See #923233.
182If this option is not specified, it means that runscript was provided 191If this option is not specified, it means that runscript was provided
183all history of package. 192all history of package.
184 193
194=item I<noreplace>
195
196Mark service as non-restartible. Interpreter B<invoke-run>, provided by
197I<runit> package does not stop sysvinit-managed instance of service to
198replace it with runit-managed instance when service is marked as
199non-restartible.
200
201Display managers (xdm, kdm, ...) are examples of non-restartible services.
202
185=item I<defaults> 203=item I<defaults>
186 204
187If you don't need other options, specify this one. 205If you don't need other options, specify this one.