Skip to content

Commit

Permalink
Update enter-systemd-namespace
Browse files Browse the repository at this point in the history
fix "nsenter: cannot open /proc/320/ns/time: No such file or directory"
according to DamionGans#36 (comment)
  • Loading branch information
Sglight authored and douglaswth committed Aug 14, 2022
1 parent 19f13ef commit 8a7a585
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 @@ -38,11 +38,11 @@ fi
USER_HOME="$(getent passwd | awk -F: '$1=="'"$SUDO_USER"'" {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 "$SUDO_USER" \
/bin/bash -c 'set -a; [ -f "$HOME/.systemd-env" ] && source "$HOME/.systemd-env"; set +a; exec bash -c '"$(printf "%q" "$@")"
else
exec /usr/bin/nsenter -t "$SYSTEMD_PID" -a \
exec /usr/bin/nsenter -t "$SYSTEMD_PID" -m -p \
/bin/login -p -f "$SUDO_USER" \
$([ -f "$USER_HOME/.systemd-env" ] && /bin/cat "$USER_HOME/.systemd-env" | xargs printf ' %q')
fi
Expand Down

0 comments on commit 8a7a585

Please sign in to comment.