phusion/baseimage-docker — pull request #81 by pda (2014-05-20 21:00:34+00:00)
Title: my_init --stderr logs to docker, not runit proctitle.

As described at http://smarden.org/runit/runsvdir.8.html passing a log option to runsvdir causes stderr to be redirected to the proctitle. That prevents stderr from reaching docker logs, which is a big problem.

This change adds a `--stderr` argument to my_init, which disables runit's the described proctitle logging, and instead allows stderr to be sent to docker logs as one would expect.

I think should should in fact be the default, but I didn't want to break backwards compatibility for anybody. Perhaps in a future version bump?

I considered `--no-proctitle` rather than `--stderr` but decided the latter is clearer and easier to remember. Feedback welcome.

I've tested running with and without `--stderr`, and confirmed that it causes stderr to be sent to docker logs instead of the proctitle.

Here is the new output of `my_init --help`:

``` usage: my_init [-h] [--enable-insecure-key] [--skip-startup-files]
[--skip-runit] [--stderr] [--no-kill-all-on-exit] [--quiet]
[MAIN_COMMAND [MAIN_COMMAND ...]]

Initialize the system.

positional arguments:
MAIN_COMMAND The main command to run. (default: runit)

optional arguments:
-h, --help show this help message and exit
--enable-insecure-key
Install the insecure SSH key
--skip-startup-files Skip running /etc/my_init.d/* and /etc/rc.local
--skip-runit Do not run runit services
--stderr Log stderr, instead of runit redirecting it to
proctitle
--no-kill-all-on-exit
Don't kill all processes on the system upon exiting
--quiet Only print warnings and errors
```