summaryrefslogtreecommitdiff
path: root/dh_installinit
diff options
context:
space:
mode:
authorjoey <joey>2002-10-11 17:54:50 +0000
committerjoey <joey>2002-10-11 17:54:50 +0000
commitc9bbccaeb003be867ff5c8e8b015da77c9156fc7 (patch)
tree9ba7552fa1522ae6c2f25c5ee2c3da59b42b62c7 /dh_installinit
parentbd891332bc47237f8c2355e1890f10b9e90499e2 (diff)
r557: * dh_installinit: added --no-start for rcS type scripts. Closes: #136502
Diffstat (limited to 'dh_installinit')
-rwxr-xr-xdh_installinit33
1 files changed, 24 insertions, 9 deletions
diff --git a/dh_installinit b/dh_installinit
index c5652c4..a9070f2 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -40,7 +40,12 @@ Do not modify postinst/postrm/prerm scripts.
=item B<-r>, B<--no-restart-on-upgrade>
-Do not restart daemon on upgrade.
+Do not restart init script on upgrade.
+
+=item B<--no-start>
+
+Do not start the init script at on install or upgrade, or stop it on removal.
+Only call update-rc.d. Useful for rcS scripts.
=item B<-d>, B<--remove-d>
@@ -135,19 +140,29 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $substvaradded=0;
if (! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst", "postinst-init",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
- # -r on the command line sets R_FLAG. If it's set,
- # there is no restart on upgrade, so don't stop
- # daemon. (It's ok that it's always started.)
- if ($dh{R_FLAG}) {
- autoscript($package,"prerm","prerm-init-norestart",
+ if (! $dh{NO_START}) {
+ # update-rc.d, and start script
+ autoscript($package,"postinst", "postinst-init",
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+
+ if ($dh{R_FLAG}) {
+ # stops script only on remove
+ autoscript($package,"prerm","prerm-init-norestart",
+ "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+ }
+ else {
+ # always stops script
+ autoscript($package,"prerm","prerm-init",
+ "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+ }
}
else {
- autoscript($package,"prerm","prerm-init",
+ # just update-rc.d
+ autoscript($package,"postinst", "postinst-init-nostart",
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
}
+
+ # removes rc.d links
autoscript($package,"postrm","postrm-init",
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
}