- Make sure you put this file in a directory that is in your
$PATH
, I personally use~/bin
and add that directory to my$PATH
chmod +x startup
to give the BASH script executable permission- When you first start your Ubuntu WSL, run
startup
, if it can't be found then it is not in your$PATH
, try runningsudo ~/bin/startup
- I also added a
restart
script to quickly restart the servies in WSL, just follow the same Instructions for the startup script - There is also a bash alias you can add to quickly check the status of all services.
Last active
July 5, 2022 14:57
-
-
Save ShawnCrigger-SOLS/2fd9d9f75f4258c191d74e5122dda119 to your computer and use it in GitHub Desktop.
Since WSL does not have systemctl, this is a hacky way to start all the services you need to start every time you reboot your WSL or Laptop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Current Version: 1.3 | |
# Starts all the services that normally startup with systemd but that does not work with WSL so | |
# until there is a real fix I wrote this shell script to really fash start all the services needed. | |
# By: Shawn Crigger | |
# Website: http://blog.shawn-crigger.com/ | |
# Now this is just a simple alias, I store all my ZSH|BASH aliases in a seoerate file called .aliases | |
# Just whereever you store your aliases just add the following if you want it.Just add the following line and resource the file your aliases are stored in | |
alias status='service --status-all' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Current Version: 1.3 | |
# Starts all the services that normally startup with systemd but that does not work with WSL so | |
# until there is a real fix I wrote this shell script to really fash start all the services needed. | |
# By: Shawn Crigger | |
# Website: http://blog.shawn-crigger.com/ | |
sudo service ssh restart | |
sudo service cron restart | |
sudo service network-manager restart | |
sudo service dbus restart | |
sudo service mysql restart | |
sudo service php7.2-fpm restart | |
sudo service apache2 restart | |
sudo service redis-server restart | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Current Version: 1.3 | |
# Starts all the services that normally startup with systemd but that does not work with WSL so | |
# until there is a real fix I wrote this shell script to really fash start all the services needed. | |
# By: Shawn Crigger | |
# Website: http://blog.shawn-crigger.com/ | |
sudo service ssh start | |
sudo service cron start | |
sudo service network-manager start | |
sudo service dbus start | |
sudo service mysql start | |
sudo service php7.2-fpm start | |
sudo service apache2 start | |
sudo service redis-server start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment