我在debian目录中有一个project.init文件(以及rules、control等),在我的rules文件中有dh_installinit (在binary-arch规则中)。
当dpkg-buildpackage完成时,初始化脚本已经被复制到debian/project/etc/init.d/project,并且已经创建了各种pre/post脚本。
但是,当我实际安装.deb (使用dpkg -i)时,init.d脚本没有安装,所以我肯定错过了这个过程的一部分。"New Maintainer's Guide“在init.d细节上相当稀疏(它基本上是说不要使用它们,因为它们太高级了)。
dh_installinit命令的详细输出为:
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发布于 2009-09-10 14:13:27
我相信您应该看看实用程序脚本"update-rc.d“,它负责在/etc/init.d/中创建/删除符号链接。
在DEBIAN控制文件"postinst“& "postrm”中使用此脚本。
例如,'postinst':update-rc.d mswitch start 20 2 3 4 5。停止0 1 6。
例如,对于'postrm':update-rc.d mswitch remove
发布于 2009-06-11 13:25:17
仅供猜测,您是否正在对其他dh_*脚本使用-P选项,而不是此脚本?如果使用该选项,则需要在所有dh_*脚本上使用该选项。
发布于 2014-02-17 18:33:49
当我只将project.init文件放到debian文件夹中,并且没有向规则文件添加任何特殊约束时,我就成功了。在这一步工作之后,测试添加你的特殊约束。
要控制debian-folder中的成功,cat *.postinst.debhelper包含:
# Automatically added by dh_installinit
if [ -x "/etc/init.d/<packagename>" ]; then
if [ ! -e "/etc/init/<packagename>.conf" ]; then
update-rc.d <packagename> defaults >/dev/null
fi
invoke-rc.d <packagename> start || exit $?
fihttps://stackoverflow.com/questions/909138
复制相似问题