Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Fix nsenter: cannot open /proc/*/ns/time: No such file or directory
Browse files Browse the repository at this point in the history
Signed-off-by: Mingi Sung <[email protected]>
  • Loading branch information
Mingi Sung committed Jan 15, 2023
1 parent 335902d commit 8eeafb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enter-systemd-namespace
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ USER_USERNAME=${SUDO_USER:-$LOGNAME}
USER_HOME="$(getent passwd | awk -F: '$1=="'"$USER_USERNAME"'" {print $6}')"
if [ -n "$SYSTEMD_PID" ] && [ "$SYSTEMD_PID" != "1" ]; then
if [ -n "$1" ] && [ "$1" != "bash --login" ] && [ "$1" != "/bin/bash --login" ]; then
exec /usr/bin/nsenter -t "$SYSTEMD_PID" -a \
exec /usr/bin/nsenter -t "$SYSTEMD_PID" -m -p \
/usr/bin/sudo -H -u "$USER_USERNAME" \
/bin/bash --norc -c "set -a; [ -f \"\$HOME/.systemd-env\" ] && source \"\$HOME/.systemd-env\"; set +a; $@"
else
exec /usr/bin/nsenter -t "$SYSTEMD_PID" -a \
exec /usr/bin/nsenter -t "$SYSTEMD_PID" -m -p \
/bin/login -p -f "$USER_USERNAME"
fi
echo "Existential crisis"
Expand Down

0 comments on commit 8eeafb0

Please sign in to comment.