Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 !

share|improve this question
    
Possibly related: How do I add an init.d script into a .deb –  Mikel Sep 19 '12 at 22:22

2 Answers 2

up vote 9 down vote accepted

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.

share|improve this answer

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

http://www.debian.org/doc/manuals/maint-guide/ch-dother.en.html#s-conffiles

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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