CentOS-WSL icon indicating copy to clipboard operation
CentOS-WSL copied to clipboard

systemctl & lsof

Open MrZhengI opened this issue 2 years ago • 2 comments

wsl2 : why systemctl Failed to get D-Bus connection: Operation not permitted lsof - i: No output for port number image

MrZhengI avatar Sep 21 '23 10:09 MrZhengI

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

anr2me avatar Feb 09 '24 18:02 anr2me