diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 1146ee7..46cbc4f 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -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): diff --git a/package/sbin/entrypoint.sh b/package/sbin/entrypoint.sh index 58eef70..435d2ff 100755 --- a/package/sbin/entrypoint.sh +++ b/package/sbin/entrypoint.sh @@ -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