CentOS-WSL
CentOS-WSL copied to clipboard
systemctl & lsof
wsl2 : why systemctl Failed to get D-Bus connection: Operation not permitted
lsof - i: No output for port number
You may need to replace the systemctl as mentioned at https://github.com/wsldl-pg/CentWSL/issues/11#issuecomment-525918756
mv /usr/bin/systemctl /usr/bin/systemctl.old
curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py > /usr/bin/systemctl
chmod +x /usr/bin/systemctl
PS: It needs python2, if not available (ie. on CentOS 9 stream), can be installed using:
wget https://github.com/niess/python-appimage/releases/download/python2.7/python2.7.18-cp27-cp27m-manylinux1_x86_64.AppImage
sudo install -m 755 python2.7.18-cp27-cp27m-manylinux1_x86_64.AppImage /usr/local/bin/
sudo ln -sr /usr/local/bin/python2.7.18-cp27-cp27m-manylinux1_x86_64.AppImage /usr/bin/python2