I have a project.init
file in the debian directory (along with rules
, control
, etc), and I have dh_installinit
in my rules
file (in the binary-arch
rule).
When dpkg-buildpackage
completes, the init script has been copied to debian/project/etc/init.d/project
, and the various pre/post scripts have been created.
However, when I actually install the .deb (with dpkg -i
), the init.d script does not get installed, so I must be missing part of this process. The "New Maintainer's Guide" is pretty sparse on init.d details (it basically says not to use them, because they are too advanced).
The verbose output of the dh_installinit command is:
dh_installinit
install -p -m755 debian/project.init debian/project/etc/init.d/project
echo "# Automatically added by dh_installinit">> debian/project.postinst.debhelper
sed "s/#SCRIPT#/project/;s/#INITPARMS#/defaults/;s/#ERROR_HANDLER#/exit \$?/" /usr/share/debhelper/autoscripts/postinst-init >> debian/project.postinst.debhelper
echo '# End automatically added section' >> debian/project.postinst.debhelper
echo "# Automatically added by dh_installinit">> debian/project.prerm.debhelper
sed "s/#SCRIPT#/project/;s/#INITPARMS#/defaults/;s/#ERROR_HANDLER#/exit \$?/" /usr/share/debhelper/autoscripts/prerm-init >> debian/project.prerm.debhelper
echo '# End automatically added section' >> debian/project.prerm.debhelper
echo "# Automatically added by dh_installinit">> debian/project.postrm.debhelper
sed "s/#SCRIPT#/project/;s/#INITPARMS#/defaults/;s/#ERROR_HANDLER#/exit \$?/" /usr/share/debhelper/autoscripts/postrm-init >> debian/project.postrm.debhelper
echo '# End automatically added section' >> debian/project.postrm.debhelper
Does your package have an entry for your init script under the Conffiles
block in /var/lib/dpkg/status
, e.g.
Package: <project>
...
Conffiles:
/etc/init.d/<project> d41d8cd98f00b204e9800998ecf8427e
and does /var/lib/dpkg/info/<project>.conffiles
contain /etc/init.d/<project>
?
Here's what's happening...
init scripts are marked as configuration files by default, since they live under /etc
.1
I'm guessing you installed the package, removed the init file, then reinstalled the package.
In this case, removing the init file counts as modifying it2, and dpkg
refuses to "overwrite" the "configuration file".
You should be able to fix the problem by removing the Conffiles
section from /var/lib/dpkg/status
.
Notes:
d41d8cd98f00b204e9800998ecf8427e
, but any non-matching checksum will cause the same behavior