I have activated the Developer Platform in Windows and installed Ubuntu VIA Windows Store which works fabulous! Only thing I need is when I "Activate" Ubuntu Apache2 and MySql does not autostart.
Is there a simple way to make this happen under this Platform? When I open Bash, I can just manually start the Services but Auto Start would be preferred. I have tried using a cron job but the services never started, perhaps my syntax was wrong?
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
@reboot . $HOME/.profile; /usr/sbin/sshd -D
@reboot . $HOME/.profile; service mysql start
@reboot . $HOME/.profile; service apache2 start
Best Answer
Found It!!!!! Although not elegant.
Instead of looping or sleeping just add "bash" to the end of the shell script. Here are my scripts for apache and mysql to run on startup.
VBS file (runs on startup) Win + r shell:startup create
autostart.vbs
autostart.sh
file (Just make this in your Home Folder,chmod +x runnable
)and in
/etc/sudoers
(Append to the end of the file)If I need to kill it all I can find the bash process in Task Manager and kill that.
Credit: https://github.com/mstrelan