diff options
author | Dmitry Bogatov <KAction@debian.org> | 2019-03-05 15:17:43 +0000 |
---|---|---|
committer | Dmitry Bogatov <KAction@debian.org> | 2019-03-05 15:17:43 +0000 |
commit | bad883cd8c4e4a2a520015141a4b685a85c450ba (patch) | |
tree | b1237bbf3475f3d2fe178dd34a839b2a44da703c /dh_runit | |
parent | 51fb67fb3fcec62888e0eccfaaaf366da1a2d31d (diff) |
Correctly create symlinks in /etc/service in post-inst on first revision of package, that introduced runscript. (Closes: #923233)
Diffstat (limited to 'dh_runit')
-rwxr-xr-x | dh_runit | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -10,11 +10,12 @@ use feature 'signatures'; | |||
10 | no warnings 'experimental'; | 10 | no warnings 'experimental'; |
11 | 11 | ||
12 | sub parse_options($opts) { | 12 | sub parse_options($opts) { |
13 | my $conf = { enable => 1 }; | 13 | my $conf = { enable => 1, since => '0.0-0' }; |
14 | for my $opt (split(/,/, $opts)) { | 14 | for my $opt (split(/,/, $opts)) { |
15 | given($opt) { | 15 | given($opt) { |
16 | when (/^disable$/) { $conf->{enable} = 0; }; | 16 | when (/^disable$/) { $conf->{enable} = 0; }; |
17 | when (/^name=(.*)$/) { $conf->{name} = $1; }; | 17 | when (/^name=(.*)$/) { $conf->{name} = $1; }; |
18 | when (/^since=(.*)$/) { $conf->{since} = $1; }; | ||
18 | when (/^logscript$/) { $conf->{logscript} = 1}; | 19 | when (/^logscript$/) { $conf->{logscript} = 1}; |
19 | when (/^defaults$/) { "do nothing"; }; | 20 | when (/^defaults$/) { "do nothing"; }; |
20 | default { error("unknown option `$opt'"); } | 21 | default { error("unknown option `$opt'"); } |
@@ -73,7 +74,8 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { | |||
73 | 74 | ||
74 | my $substitutions = { | 75 | my $substitutions = { |
75 | NAME => $name, | 76 | NAME => $name, |
76 | ENABLE => $conf->{enable} ? "yes" : "no" | 77 | ENABLE => $conf->{enable} ? "yes" : "no", |
78 | SINCE => $conf->{since} | ||
77 | }; | 79 | }; |
78 | 80 | ||
79 | runit_autoscript($pkg, 'postrm', $substitutions); | 81 | runit_autoscript($pkg, 'postrm', $substitutions); |
@@ -166,6 +168,17 @@ the rights of the dedicated user. Specifying this option produces | |||
166 | an error if the path argument names a directory that already | 168 | an error if the path argument names a directory that already |
167 | contains a F</log/run> script. | 169 | contains a F</log/run> script. |
168 | 170 | ||
171 | =item I<since> | ||
172 | |||
173 | Specify what version of package introduced runscript. Correct | ||
174 | installation of symlinks in F</etc/service> requires this information to | ||
175 | correctly distinguish cases, when system administrator deliberately | ||
176 | disabled service and case, when runscript was not provided in previous | ||
177 | version of package. See #923233. | ||
178 | |||
179 | If this option is not specified, it means that runscript was provided | ||
180 | all history of package. | ||
181 | |||
169 | =item I<defaults> | 182 | =item I<defaults> |
170 | 183 | ||
171 | If you don't need other options, specify this one. | 184 | If you don't need other options, specify this one. |