1

I'm using equivs-build to package up some internal apps for distribution to our subsidiaries. Many require an equivalent script in /etc/init.d to kick off the app at boot.

Questions:

  1. When I try to copy a file directly to /etc/init.d apt-get always appends ".dpkg-dist" to it. Why? It isn't appending anything to the my other files.
  2. How would I go about setting up a link from /etc/rc3.d to the startup script in /etc/init.d?

EDIT: well it appears that #1 is due to the file (apparently) being a replacement for an existing version of the same. Except that there wasn't a file there before. So it appears that the install is copying in the file, then replacing it?

1
  • I strongly suggest you stop using equivs-build which isn't really meant to building useful packages. Instead take a look at using FPM for building packages quickly. My guess is that your package isn't setup properly for conffiles.
    – Zoredache
    Oct 24, 2013 at 6:51

1 Answer 1

0

To solve this:

  1. Copy the script control file to /tmp (via the equivs-build control file)
  2. In the postinst file move it to /etc/init.d
  3. Run /usr/sbin/update-rc.d <script file> defaults to make the link to the appropriate /etc/rc.d folders

Example:

#! /bin/sh

case "$1" in
    configure)
            if [ -f /tmp/runonce ]
            then
                    mv /tmp/script-monitor /etc/init.d
                    chmod oug+x /etc/init.d/script-monitor

                    /usr/sbin/update-rc.d script-monitor defaults
            fi
    ;;
esac

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .