Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/var/log/socklog/cron: Permission denied #2

Closed
miracle2k opened this issue Feb 21, 2018 · 3 comments
Closed

/var/log/socklog/cron: Permission denied #2

miracle2k opened this issue Feb 21, 2018 · 3 comments

Comments

@miracle2k
Copy link

I added this to a Dockerfile along with s6-overlay. I want to see the log output of cron without installing rsyslog proper.

After I start my container, I see repeatedly this message in the docker logs:

s6-log: fatal: unable to mkdir /var/log/socklog/cron: Permission denied

Container is ubuntu:16:04.

root@4961014f1773:/var/log/socklog# ls -lah
total 48K
drwxr-x--- 22 32768 32768 4.0K Feb 21 01:53 .
drwxr-xr-x  8 root  root  4.0K Feb 21 01:53 ..
drwxr-x---  2 32768 32768 4.0K Nov  2 18:01 cron
```

I basically just have a single file in `/etc/services.d/cron/run` that reads:

```
#!/usr/bin/with-contenv sh

exec cron -f
```

What are the right permissions for me to use?
@miracle2k
Copy link
Author

So it turns out that the problem is that the fix-attrs.d file that socklog uses wants to set the user to nobody:nogroup, which somehow fails. As a result, the numerical fallback ids are used which do not represent any actual user in my container.

@jprjr
Copy link
Member

jprjr commented Feb 21, 2018

Can you post your full Dockerfile? I'm unable to reproduce.

I used:

FROM ubuntu:16.04

# Install s6-overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.2/s6-overlay-amd64.tar.gz /tmp/
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C /

# Install socklog-overlay
ADD https://github.com/just-containers/socklog-overlay/releases/download/v2.1.0-0/socklog-overlay-amd64.tar.gz /tmp/
RUN tar xzf /tmp/socklog-overlay-amd64.tar.gz -C /

RUN apt-get update && \
    apt-get install -y cron

COPY root /

ENTRYPOINT ["/init"]

Then under root/etc/services.d/cron/run I have:

#!/usr/bin/with-contenv sh

exec cron -f

And everything is working fine.

@miracle2k
Copy link
Author

I was using an old version of s6-overlay, which exhibited the fix-attrs issue I mentioned above. Upgrading fixed it, sorry for the bother.

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

No branches or pull requests

2 participants