summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 38aa3424..1e90e08a 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 00000000..5d882b6f
--- /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 81b37007..792443e6 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 af55f9f8..004e21f0 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 c5652c45..a9070f2d 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/");
}