Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

add a custom.sh script for post-startup functions #103

Open
blacksteel1288 opened this issue Mar 20, 2022 · 0 comments
Open

add a custom.sh script for post-startup functions #103

blacksteel1288 opened this issue Mar 20, 2022 · 0 comments

Comments

@blacksteel1288
Copy link

blacksteel1288 commented Mar 20, 2022

it would be very useful to have a custom.sh script that runs as part of the entrypoint.sh scripts. this could be used for any further customizations, or in my case, to add external logging to a centralized log server and to set a default IP blacklist with iptables.

this could potentially be done by something along the lines of modifying https://github.com/iredmail/dockerized/blob/master/entrypoints/all_in_one.sh

to add this after line 74:

run_entrypoint ${CUSTOM_DIR}/custom.sh

currently, to add external logging, I have to run a custom start_iredmail.sh script to start the iredmail container that contains lines like this:

docker exec -d iredmail bash -c "tail -n 0 -q -F /var/log/fail2ban/fail2ban.log >> /proc/1/fd/1"

while this does work, it requires me to start the container manually all the time. I can't use the standard docker run or docker-compose up to start iredmail. So, on unplanned restarts when the container starts automatically, these custom commands are not called.

adding a custom.sh option on the entrypoint.sh would solve this.

additionally/alternatively, it would be great if there was a way to set rsyslog configurations for external logging, as currently not all logs appear in stdout, which is required for docker containers to send logs to remote log servers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant