erfanrocker

Systemd WSL CentOS

Apr 12th, 2021 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Find out where systemctl is:
  2.  
  3. which systemctl
  4.  
  5. Use the path to systemctl for the following commands.
  6.  
  7. Install Python 2 (if not available by default):
  8.  
  9. sudo dnf install python2 -y
  10. sudo ln -s /usr/bin/python2 /usr/bin/python
  11.  
  12. Wrap systemctl in Python (or somehow let systemctl work with systemd not on PID 1):
  13.  
  14. sudo mv /usr/bin/systemctl /usr/bin/systemctl.old
  15. curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py >temp
  16. sudo mv temp /usr/bin/systemctl
  17. sudo chmod +x /usr/bin/systemctl
  18.  
  19. sudo dnf install nginx -y
  20. sudo systemctl start nginx
  21. curl localhost
  22. sudo systemctl stop nginx
Add Comment
Please, Sign In to add comment