30
30
etc/default/package in the package build directory, with "package" replaced
31
31
by the package name.
33
Historically this program generates postrm and prerm commands that run the
34
init scripts by hand. In V4 mode, it uses the invoke-rc.d program instead.
35
See L<debhelper(1)> for details about V4 mode. If you decide to use this, you
36
should make your package depend on sysvinit (>= 2.80-1) (this dependency is
37
added to ${misc:Depends} by this program in V4 mode).
47
41
=item B<-r>, B<--no-restart-on-upgrade>
49
Do not restart daemon on upgrade.
43
Do not restart init script on upgrade.
47
Do not start the init script on install or upgrade, or stop it on removal.
48
Only call update-rc.d. Useful for rcS scripts.
51
50
=item B<-d>, B<--remove-d>
63
62
Pass "params" to L<update-rc.d(8)>. If not specified, "defaults" will be
64
63
passed to L<update-rc.d(8)>.
65
=item B<--name=>I<name>
67
Install the init script (and default file) using the filename I<name>
68
instead of the default filename, which is the package name. When this
69
parameter is used, dh_installinit looks for and installs files named
70
debian/package.name.init and debian/package.name.default, instead of the
71
usual debian/package.init and debian/package.default.
66
73
=item B<--init-script=>I<scriptname>
68
Use "scriptname" as for the filename the init script is installed as in
75
Use "scriptname" as the filename the init script is installed as in
69
76
etc/init.d/ (and also use it as the filename for the defaults file, if it
70
is installed). This is useful if you need to have an init script with a name
71
different from the package's name. Note that if you use this parameter,
72
dh_installinit will look to see if a file in the debian/ directory exists
73
that looks like "package.scriptname" and if so will install it as the init
74
script in preference to the files it normally installs. This feature is really
75
only useful if you need a single package to install more than one init script.
77
is installed). If you use this parameter, dh_installinit will look to see
78
if a file in the debian/ directory exists that looks like
79
"package.scriptname" and if so will install it as the init script in
80
preference to the files it normally installs.
82
This parameter is deprecated, use the --name parameter instead.
84
=item B<--error-handler=>I<function>
86
Call the named shell function if running the init script fails. The
87
function should be provided in the prerm and postinst scripts, before the
138
154
if ($params eq '') {
139
155
$params="defaults";
143
158
if (! $dh{NOSCRIPTS}) {
144
# In v4 mode, use invoke-rc.d versions of the
145
# autoscripts; prior to that use the old,
146
# manual-invoking versions.
150
addsubstvar($package, "misc:Depends", "sysvinit", ">= 2.80-1");
153
# -r on the command line sets R_FLAG. If it's set,
154
# there is no restart on upgrade.
156
autoscript($package,"postinst", "postinst-init-norestart$tailstr",
157
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
158
autoscript($package,"prerm","prerm-init-norestart$tailstr",
159
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
159
if (! $dh{NO_START}) {
160
# update-rc.d, and start script
161
autoscript($package,"postinst", "postinst-init",
162
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
165
# stops script only on remove
166
autoscript($package,"prerm","prerm-init-norestart",
167
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
170
# always stops script
171
autoscript($package,"prerm","prerm-init",
172
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
162
autoscript($package,"postinst","postinst-init$tailstr",
163
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
164
autoscript($package,"prerm","prerm-init$tailstr",
165
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
177
autoscript($package,"postinst", "postinst-init-nostart",
178
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
167
# This script just removes the links, so it's the
168
# same for all varients.
169
182
autoscript($package,"postrm","postrm-init",
170
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
173
if (! $substvaradded) {
174
# Remove it, for idemotency's sake.
175
addsubstvar($package, "misc:Depends", "sysvinit", ">= 2.80-1", 1);
183
"s/#SCRIPT#/$script/;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
184
192
This program is a part of debhelper.