question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to run a upstart init script using dumb-init?

See original GitHub issue

I have an upstart init script called goservice.conf and it’s contents are as follows,

description "test.conf"

start on runlevel [2345]
stop on shutdown

respawn
respawn limit 5 2

script
     if [-n "/usr/share/main"]; then
      mkdir -p /usr/share/main
     fi
     exec su --session-command="cd ~/ansible/ ; ./main " root 

end script 

How to run this file using dumb-init so that , if a child process stops ,it is spawned again? Also does dumb-init provides feature to start and stop child processes like upstart , for example: start <service -name> or stop <service-name>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
samrocketmancommented, Feb 28, 2018

@kanapuliAthavan there are bolt-on container friendly “service managers” which can be used. An example is runit. Here’s an example of running a multi-service container with runit.

ENTRYPOINT ['/dumb-init', '--']
CMD ['/usr/bin/runsvdir', '-P', '/etc/service']

Where /etc/service directory contains multiple services like:

It’s probably obvious but… the above is an example using dumb-init and runit to start three services inside of a container: cron, sshd, and syslog-ng.

Note: I’ve personally moved away from this kind of multi-service container and now use multiple containers with docker-compose and collecting logs from docker the way it’s meant to be in docker. In general, I do not recommend this but am giving you this solution since you seem adament to want this.

I also do not want dumb-init to become smart-init. The only reason I use dumb-init instead of tini is because of its dead simplicity.

1reaction
kanapulicommented, Mar 1, 2018

@samrocketman Thanks for the detailed explanation. I think , we can close this issue thread now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Choosing an init process for multi-process containers
In this article I explored pros and cons of some of the options like supervisord, runit, monit, tini/dumb-init, s6 (audience favorite), and tini ......
Read more >
Introducing dumb-init, an init system for Docker containers
In this post we introduce dumb-init, a simple init system written in C which we use inside our containers. Lightweight containers have made ......
Read more >
rhel6-init - Certified Container Image
It is based on a small container-friendly 'dumb-init' instead of upstart. This container image allows customers to run one or more services in...
Read more >
Systemd vs. Docker
Each image author creates his or her own crazy startup script for the ... The issue here is that if you don't run...
Read more >
An Init System inside the Docker Container
Suppose you run a web server inside the container which runs bash script. ... A simple init system is to use bash inside...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found