summaryrefslogtreecommitdiff
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
parentbd891332bc47237f8c2355e1890f10b9e90499e2 (diff)
r557: * dh_installinit: added --no-start for rcS type scripts. Closes: #136502
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm1
-rw-r--r--autoscripts/postinst-init-nostart3
-rw-r--r--debian/changelog6
-rwxr-xr-xdh_install2
-rwxr-xr-xdh_installinit33
5 files changed, 35 insertions, 10 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index 38aa342..1e90e08 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -101,6 +101,7 @@ sub parseopts {
"r" => \$options{R_FLAG},
"no-restart-on-upgrade" => \$options{R_FLAG},
+ "no-start" => \$options{NO_START},
"k" => \$options{K_FLAG},
"keep" => \$options{K_FLAG},
diff --git a/autoscripts/postinst-init-nostart b/autoscripts/postinst-init-nostart
new file mode 100644
index 0000000..5d882b6
--- /dev/null
+++ b/autoscripts/postinst-init-nostart
@@ -0,0 +1,3 @@
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+ update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+fi
diff --git a/debian/changelog b/debian/changelog
index 81b3700..792443e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+debhelper (4.1.17) unstable; urgency=low
+
+ * dh_installinit: added --no-start for rcS type scripts. Closes: #136502
+
+ -- Joey Hess <joeyh@debian.org> Fri, 11 Oct 2002 13:58:22 -0400
+
debhelper (4.1.16) unstable; urgency=low
* Depend on po-debconf, and I hope I can drop the debconf-utils dep soon.
diff --git a/dh_install b/dh_install
index af55f9f..004e21f 100755
--- a/dh_install
+++ b/dh_install
@@ -12,7 +12,7 @@ use Debian::Debhelper::Dh_Lib;
=head1 SYNOPSIS
-B<dh_install> [B<-X>I<item>] [B<--autodest>] [B<--list-missing>] [S<I<debhelper options>>] [S<I<file [...] dest>>]
+B<dh_install> [B<-X>I<item>] [B<--autodest>] [B<--list-missing>] [B<--sourcedir=>I<dir>] [S<I<debhelper options>>] [S<I<file [...] dest>>]
=head1 DESCRIPTION
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/");
}