I have a source package where I want to add a simple init.d script. I know dh_installinit should help : when I run it, it creates examples of postrm, prerm, postinstall to perform an update-rc.d after install (which is OK to me by the way) But I can't make my new created package to copy the file to /etc/init.d when I do apt-get install !

Thank you in advance serverfault community !


2 Answers 2


From dh_installinit(1):

If a file named debian/package.init exists, then it is installed into etc/init.d/package in the package build directory, with "package" replaced by the package name.

If a file named debian/package.default exists, then it is installed into etc/default/package in the package build directory, with "package" replaced by the package name.


Found this:

The /etc/init.d scripts must be treated as configuration files, either (if they are present in the package, that is, in the .deb file) by marking them as conffiles, or, (if they do not exist in the .deb) by managing them correctly in the maintainer scripts (see Configuration files, Section 10.7). This is important since we want to give the local system administrator the chance to adapt the scripts to the local system, e.g., to disable a service without de-installing the package, or to specify some special command line options when starting a service, while making sure their changes aren't lost during the next package upgrade

In http://www.debian.org/doc/debian-policy/ch-opersys.html

Here's the docs on using conffiles


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.