I've been trying to get these two to start when my docker image starts but they never seem to start.


command=/bin/bash "service rsyslog start"

command=/bin/bash "service haproxy start"

What command is needed to start both in the order of rsyslog first then haproxy?

3 Answers 3


This is not going to work because service ... start command starts the programm as daemon and sends it in the background. The supervisord can't deal with that rather it needs to start them as subprocess and run them in forground. See here:

Programs meant to be run under supervisor should not daemonize themselves. Instead, they should run in the foreground. They should not detach from the terminal from which they are started. The easiest way to tell if a program will run in the foreground is to run the command that invokes the program from a shell prompt. If it gives you control of the terminal back, but continues running, it’s daemonizing itself and that will almost certainly be the wrong way to run it under supervisor. You want to run a command that essentially requires you to press Ctrl-C to get control of the terminal back. If it gives you a shell prompt back after running it without needing to press Ctrl-C, it’s not useful under supervisor. All programs have options to be run in the foreground but there’s no “standard way” to do it; you’ll need to read the documentation for each program.

Here is a “real world” program configuration example from supervisord documentation:

Apache 2.2.6:

command=/path/to/httpd -c "ErrorLog /dev/stdout" -DFOREGROUND

Your programm's startup scripts can be a good place to find out how the program starts, for proper configuration.

Some examples are here


command=service rsyslog start

command=service haproxy start

However, now I must delay starting haproxy as haproxy requires rsyslog to be started before hand. This however is another problem.


You need to put something like that, just adjust parameters

command=/sbin/rsyslogd -n -a /var/run/systemd/journal/syslog


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.