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

infra/image/dockerfile/c10s: Fix client part deployment for the server #1316

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion infra/image/dockerfile/c10s
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ dnf --assumeyes install \
bash \
systemd \
procps-ng \
iproute; \
iproute \
hostname; \
rm -rf /var/cache/dnf/;

# Prepare for basic ipa-server-install in container
# Address failing nis-domainname.service in the ipa-client-install step
RUN mv /usr/bin/nisdomainname /usr/bin/nisdomainname.orig
ADD utils/hostnamectl-wrapper /usr/bin/nisdomainname
RUN chmod a+rx /usr/bin/nisdomainname

RUN (cd /lib/systemd/system/; \
if [ -e dbus-broker.service ] && [ ! -e dbus.service ]; then \
ln -s dbus-broker.service dbus.service; \
Expand Down
12 changes: 12 additions & 0 deletions infra/image/utils/hostnamectl-wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -eu

if setpriv --dump | grep -q sys_admin ; then
if [[ "$( basename $0 )" =~ "domainname" ]] ; then
/usr/bin/hostname -y "$@"
else
$0.orig "$@"
fi
else
echo "Skipping invocation of $0 $@ in unprivileged container." >&2
exit
fi