Skip to content

Commit

Permalink
Add SC4S_DEBUG_CONTAINER to prevent container exit on startup error
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaircloth-splunk committed Jun 14, 2020
1 parent f66501f commit 238305c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ and navigate to `/opt/syslog-ng/etc/` to see the actual config files in use. If
itself, you can also modify files directly and reload syslog-ng with the command `kill -1 1` in the container. This is an advanced topic
and futher help can be obtained via the github issue tracker and Slack channels.

When debugging a configuration syntax issue at startup the container must remain running. This can be enabled by adding `SC4S_DEBUG_CONTAINER=yes` to the `env_file`

## Run the container with a null entrypoint (Advanced!)

You can run the container without the usual entrypoint shell script by executing this command (modified to suit your environment):
Expand Down
8 changes: 7 additions & 1 deletion package/sbin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ sleep 5
if ! ps -p $pid > /dev/null
then
echo "syslog-ng failed to start $pid is not running"
exit $(wait ${pid})
/opt/syslog-ng/sbin/syslog-ng -s
if [ "${SC4S_DEBUG_CONTAINER}" == "yes" ]
then
exit $(wait ${pid})
else
tail -f /dev/null
fi
# Do something knowing the pid exists, i.e. the process with $PID is running
fi

Expand Down

0 comments on commit 238305c

Please sign in to comment.