DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images
1.56k stars 383 forks source link

Sleeping for 1 second to let systemd settle nsenter: cannot open /proc/25/ns/time: No such file or directory #74

Open ghost opened 2 years ago

ghost commented 2 years ago

image

UsamiRenko04 commented 2 years ago

+1 我也是这情况

CleanHit commented 2 years ago

Same here

CleanHit commented 2 years ago

@lyh2048 https://github.com/DamionGans/ubuntu-wsl2-systemd-script/issues/76#issuecomment-1122717349

n1klaus commented 2 years ago

+1

shixinwang commented 2 years ago

same here

myxoh commented 2 years ago

Assuming you didn't install this on root you can start wsl as root using:

 wsl --user root

Because this installs on the bash init script you should be able to log in (at least I could)

From root I was able to run the uninstall script from this fork: https://github.com/FiestaLake/ubuntu-wsl2-systemd-script/blob/master/uninstall.sh

(Or a slightly modified version to run as the root user)

self_dir=$(pwd)
rm -rf /usr/sbin/start-systemd-namespace
rm -rf /usr/sbin/enter-systemd-namespace
rm -rf /etc/sudoers.d/systemd-namespace

cd /var/tmp
if [ -f "/etc/bash.bashrc" ]; then
sudo grep -v "# Start or enter a PID namespace in WSL2
export USE_WSLG_SOCKET=false
export USE_WSLG_SOCKET=true
source /usr/sbin/start-systemd-namespace" /etc/bash.bashrc > tmpfile
sudo mv tmpfile /etc/bash.bashrc
fi
cd $self_dir

Hope this helps restore your envirnoment.