From: joey Date: Fri, 11 Oct 2002 17:54:50 +0000 (+0000) Subject: r557: * dh_installinit: added --no-start for rcS type scripts. Closes: #136502 X-Git-Tag: version_2.0.101~42 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c9bbccaeb003be867ff5c8e8b015da77c9156fc7;p=debhelper.git r557: * dh_installinit: added --no-start for rcS type scripts. Closes: #136502 --- 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 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 [B<-X>I] [B<--autodest>] [B<--list-missing>] [S>] [S>] +B [B<-X>I] [B<--autodest>] [B<--list-missing>] [B<--sourcedir=>I] [S>] [S>] =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/"); }