#1374 optionally use sudo for hardlink phase
Closed: Invalid 4 years ago by lsedlar. Opened 4 years ago by kevin.

There's been a desire for composes to not need to run as root (as we normally do them in fedora).

For f32 beta @mohanboddu tried this, but the compose failed when it got to the hardlinking:

2020-03-12 02:26:37 [INFO ] [DONE ] Running pipeline (1/3). Phases: buildinstall
2020-03-12 02:26:37 [ERROR ] Compose run failed: [Errno 1] Operation not permitted: '/mnt/koji/packages/0ad/0.0.23b/11.fc32/data/signed/12c944d0/src/0ad-0.0.23b-11.fc32.src.rpm' -> '/mnt/koji/compose/32/Fedora-32-20200311.0/compose/Everything/source/tree/Packages/0/0ad-0.0.23b-11.fc32.src.rpm'

So, could there be a config option or perhaps just a check if you aren't running as root to use sudo for the hardlink calls?
Or perhaps I guess just not use hardlink if you are not running as root?

Or is this entire idea of not running as root futile? :)


Oops. I missed your comment on the downstream infra ticket.

We can try adjusting /proc/sys/fs/protected_hardlinks

I don't think sudo is an option here. Pungi creates the hardlinks by calling os.link function, so there's no extra process that could be wrapped in sudo.

If the /proc option doesn't work, you'd either have to run as root or disable hardlinking. However I'm pretty confident the option should work.

Metadata Update from @lsedlar:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata