summaryrefslogtreecommitdiff
path: root/dh_installinit
diff options
context:
space:
mode:
authorjoey <joey>2004-06-29 00:03:54 +0000
committerjoey <joey>2004-06-29 00:03:54 +0000
commitad092508ea530253700749a3119bf8a24dcc162e (patch)
tree9c5bcde32f8bea565082d18d9e749c39741309b6 /dh_installinit
parent62d0cab3e04ec95e5c62a58d291018a1ebce228f (diff)
r1691: * dh_installinit: Added --error-handler option. Based on work by Thom May.
Closes: #209090
Diffstat (limited to 'dh_installinit')
-rwxr-xr-xdh_installinit18
1 files changed, 12 insertions, 6 deletions
diff --git a/dh_installinit b/dh_installinit
index 360f378..aba32b8 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -81,6 +81,12 @@ preference to the files it normally installs.
This parameter is deprecated, use the --name parameter instead.
+=item B<--error-handler=>I<function>
+
+Call the named shell function if running the init script fails. The
+function should be provided in the prerm and postinst scripts, before the
+#DEBHELPER# token.
+
=back
=head1 NOTES
@@ -148,33 +154,33 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if ($params eq '') {
$params="defaults";
}
-
+
if (! $dh{NOSCRIPTS}) {
if (! $dh{NO_START}) {
# update-rc.d, and start script
autoscript($package,"postinst", "postinst-init",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+ "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
if ($dh{R_FLAG}) {
# stops script only on remove
autoscript($package,"prerm","prerm-init-norestart",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+ "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
}
else {
# always stops script
autoscript($package,"prerm","prerm-init",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+ "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
}
}
else {
# just update-rc.d
autoscript($package,"postinst", "postinst-init-nostart",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+ "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
}
# removes rc.d links
autoscript($package,"postrm","postrm-init",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+ "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
}
}
}