Log file owner is root instead of webapp - Ruby 3 on Elastic Beanstalk on Amazon Linux 2

0

Hi,

Sometimes, after a deployment or it possibly may only happen after an AWS initiated instance replacement (seems that quite often a new instance is brought up to replace an instance), my log files are owned by root instead of webapp user.

The app is running as webapp so the log files do not get written to, as there is no permissions to do so.

No idea why this is happening. Any thoughts?

Rails 6 app, log files directory is /var/app/current/log/

For example:

[ec2-user@ip-172-31-32-66 log]$ ls -lrta
total 4
-rw-r--r--  1 webapp webapp    0 Nov  9 02:42 .keep
-rw-r--r--  1 root   root      0 Nov 12 18:41 production.log
drwxr-xr-x  2 webapp webapp   41 Nov 12 18:41 .
drwxr-xr-x 17 webapp webapp 4096 Nov 12 18:42 ..

Thanks.

ab
asked a year ago88 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions