diff options
Diffstat (limited to 'dh_runit')
-rwxr-xr-x | dh_runit | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -5,6 +5,7 @@ use v5.10.1; | |||
5 | use strict; | 5 | use strict; |
6 | use Debian::Debhelper::Dh_Lib; | 6 | use Debian::Debhelper::Dh_Lib; |
7 | use File::Find; | 7 | use File::Find; |
8 | use File::Path qw(make_path); | ||
8 | use File::stat; | 9 | use File::stat; |
9 | use feature 'signatures'; | 10 | use feature 'signatures'; |
10 | no warnings 'experimental'; | 11 | no 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. | |||
182 | If this option is not specified, it means that runscript was provided | 191 | If this option is not specified, it means that runscript was provided |
183 | all history of package. | 192 | all history of package. |
184 | 193 | ||
194 | =item I<noreplace> | ||
195 | |||
196 | Mark service as non-restartible. Interpreter B<invoke-run>, provided by | ||
197 | I<runit> package does not stop sysvinit-managed instance of service to | ||
198 | replace it with runit-managed instance when service is marked as | ||
199 | non-restartible. | ||
200 | |||
201 | Display managers (xdm, kdm, ...) are examples of non-restartible services. | ||
202 | |||
185 | =item I<defaults> | 203 | =item I<defaults> |
186 | 204 | ||
187 | If you don't need other options, specify this one. | 205 | If you don't need other options, specify this one. |