fluentd-docker-image icon indicating copy to clipboard operation
fluentd-docker-image copied to clipboard

Errors in entrypoint while running as root

Open dshmatov opened this issue 6 years ago • 1 comments

I'm running Fluentd as root user by setting env variable FLUENT_UID=0. I do this in the case of using fluent-plugin-systemd plugin which needs access to journald as root user. It leads to the bunch of errors in entrypoint script after each restart, like:

WARNING: You are just about to delete the root account (uid 0)
Usually this is never required as it may render the whole system unusable
If you really want this, call deluser with parameter --force
Stopping now without having performed any action
useradd: user 'fluent' already exists

It can be simply fixed buy not always try to delete and create fluentd user. Let's create it only when container starts and do nothing while restarting. Is it mandatory to always delete and create user?

dshmatov avatar May 31 '18 14:05 dshmatov

Sorry, I missed this issue. Delete user is for preventing unexpected behaviour for fluentd and it doesn't consider for uid=0. One way is use own entrypoint.sh to overwrite default entrypoint.sh, or update our entrypoint.sh to skip user/gosu handling when uid is 0.

repeatedly avatar Jun 11 '18 14:06 repeatedly