Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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 '13 at 6:51
add comment

1 Answer

up vote 0 down vote accepted

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
share|improve this answer
add comment

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.