1

I have a start-stop script in /etc/init/

With this script I can start a bash-script with: service <script> start/stop.

I want this script to start automatically when the container starts. So there for I used the command update-rc.d <script> defaults

But when I restart the container the won't automatically starts.

If I log in the container and I start the script with: service <script> start , the starts correctly.

Also I see that there are symbolic links in /etc/rc1.d (etc) to start the init script.

How can I solve that the init script start automatically after a restart of my container.

arjan kroon
  • 813
  • 2
  • 9
  • 22
  • Could you provide more info about the script in /etc/init? I suppose there is a problem with you starting script, or you are linking it in a wrong way – v.bontempi Nov 11 '15 at 10:10

1 Answers1

0

You could consider using phusion/baseimage-docker as a base image.
It is made to declare "services":

You can add additional daemons (e.g. your own app) to the image by creating runit entries. You only have to write a small shell script which runs your daemon, and runit will keep it up and running for you, restarting it when it crashes, etc.

The shell script must be called run, must be executable, and is to be placed in the directory /etc/service/.

That helps taking care of the zombie processes.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250