5

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 !

Mikel
  • 3,727
  • 2
  • 19
  • 16
Falken
  • 1,682
  • 5
  • 18
  • 27
  • Possibly related: [How do I add an init.d script into a .deb](http://stackoverflow.com/questions/909138/how-do-i-add-an-init-d-script-into-a-deb) – Mikel Sep 19 '12 at 22:22

2 Answers2

10

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.

Teddy
  • 5,134
  • 1
  • 22
  • 27
2

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

Teddy
  • 5,134
  • 1
  • 22
  • 27
Swoogan
  • 2,007
  • 1
  • 13
  • 21