v1.2.0 newrelic-daemon fails to run in foreground in Ubuntu xenial docker-container
The following shell script is installed in /etc/service/newrelic/run of an Ubuntu 16.04.2 LTS docker container along with newrelic-daemon built from the source in this repository:
#!/bin/bash
./newrelic-daemon -f --logfile stderr --loglevel "${NEW_RELIC_LOG_LEVEL:-warning}"
Under v1.1.0, the newrelic-daemon process worked as expected.
Under v1.2.0, it appears to fork a process instead of running in the foreground. As a result, runsv starts another one... and then another one... until the container runs out of space!
Here's the log output:
2019/10/21 20:57:37.991708 (452) Info: New Relic daemon version 1.2.0.0-520519d615c0 [listen="/tmp/.newrelic.sock" startup=init pid=452 ppid=451 uid=0 euid=0 gid=0 egid=0 runtime="go1.13.1" GOMAXPROCS=6 GOOS=linux GOARCH=amd64]
2019/10/21 20:57:37.992003 (452) Info: collector configuration is &{CAFile: CAPath: Proxy:}
2019/10/21 20:57:37.992288 (452) Info: daemon listening on /tmp/.newrelic.sock
This behavior does not occur when I run the script from an interactive terminal. When runsv runs the script, there is no tty associated with the process. Perhaps this causes trouble?
Hi @burgerrg, thanks for filing this issue! I'm happy to look into it today and get back to you about my findings!