Fix systemd config permissions
When the `Containerfile` `ADD` instruction runs against files from a git repository, it's easily possible the permissions will be incorrect inside the container. Because systemd configuration and units are rather important, update the setup script to ensure they're always set correctly. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
@@ -190,6 +190,15 @@ function finalize_ownership() {
|
||||
# and also to the `ADD` instruction in the `Containerfile`.
|
||||
chown -R runner:runner /home/runner
|
||||
chown -R podman:podman /home/podman
|
||||
|
||||
# Ensure correct permissions of system configuration files.
|
||||
# Somehow these can be set incorrectly during Containerfile
|
||||
# ADD instruction.
|
||||
local path
|
||||
for path in "/etc/systemd/system.conf.d" "/etc/systemd/system/user-.slice.d"; do
|
||||
chown root:root ${path}/*
|
||||
chmod 0644 ${path}/*
|
||||
done
|
||||
}
|
||||
|
||||
check_vars
|
||||
|
||||
Reference in New Issue
Block a user