Giter Club home page Giter Club logo

Comments (8)

giuseppe avatar giuseppe commented on July 24, 2024

There is probably no user session for the ansible user so Podman fall backs to create the rundir in the home directory.

Are you sure you want to run podman as the ansible user and not as root?

If you really want it, I suggest enabling lingering mode for that user (loginctl enable-linger ansible)

from podman.

romanwoessner avatar romanwoessner commented on July 24, 2024

I want to have a rootless container. Therefore the HAProxy container is running in the user space of the the ansible user. Lingering mode is already activated for this user.

from podman.

giuseppe avatar giuseppe commented on July 24, 2024

strange that the /home/ansible/rundir directory is created when there is a user session.

do you get the same error if you run sudo -u ansible /usr/libexec/keepalived/haproxy_check.sh manually?

Can you temporarily turn off selinux to see if it is blocking the access to the directory?

from podman.

romanwoessner avatar romanwoessner commented on July 24, 2024

Turning off SELinux, does not change the behavior. That is something I have already tested.

$ sestatus
SELinux status:                 disabled

Running the script as ansible user works as exptected:

$ /usr/libexec/keepalived/haproxy_check.sh
59f82621245d

Yes, I get the same error running it manually with sudo -u ansible:

$ sudo -u ansible /usr/libexec/keepalived/haproxy_check.sh
ERRO[0000] unable to make rootless runtime: mkdir /home/ansible/rundir/containers: permission denied

But, after stopping keepalived and removing the rundir with its 0600 permissions, it works:

$ sudo systemctl stop keepalived.service
$ rm -rf ~/rundir
$ sudo -u ansible /usr/libexec/keepalived/haproxy_check.sh
59f82621245d
$ ls -la ~/rundir
drwx------   3 ansible ansible   24 25. Jun 09:49 .
drwx------. 12 ansible ansible 4096 25. Jun 09:49 ..
drwx------   2 ansible ansible    6 25. Jun 09:49 containers

In this case, it gets created with sufficient permissions 0700.

As soon as I remove the rundir and start the keepalived service again, Podman recreates it with insufficient permissions:

$ rm -rf ~/rundir
$ sudo systemctl start keepalived.service
$ sudo ls -la /home/ansible/rundir
drw-------   2 ansible ansible    6 25. Jun 09:51 .
drwx------. 12 ansible ansible 4096 25. Jun 09:51 ..

It seems that only running the script from within keepalived causes this issue.
I appreciate any help.

from podman.

giuseppe avatar giuseppe commented on July 24, 2024

it smells like keepalived is using the wrong umask.

Can you try to override the umask value to something like 0022?

EDIT:

if https://github.com/acassen/keepalived/blob/master/lib/utils.c#L73 is the default umask used by keepalived, then that explains the missing exec bit set for the directory

from podman.

giuseppe avatar giuseppe commented on July 24, 2024

@romanwoessner had a chance to try overriding the umask value?

from podman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.