I have a script that I would like to run when my system starts. I have put it on "rc.local", but it doesn't work. How can I enable it to run on startup?
|
Can you run your script manually? If not, it's a problem with that script; otherwise look more at rc.local. (If that script needs to run as root, you need use sudo to manually run it.) Make sure /etc/rc.local is executable and that the script it calls is also executable.
Make sure rc.local has a shebang line (which is the default):
|
|||||||||||||||||||||
|
|
In my case none of the instructions were a perfect solution. If you were as unlucky as me, try this detailed one
|
|||||||||||||||||
|
|
On newer Ubuntu versions Check if the Compatibility service is loaded with
If it contains active (exited) your setting seems fine and you could have another error in your |
|||||
|
|
2 suggestions.
My bad. Just check one then. Thanks for the correction enzotib :) |
|||||
|
protected by Community♦ Jul 16 '14 at 16:43
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

systemctl status rc-local.service– rubo77 Apr 21 '16 at 8:09echo $PATH > /home/rc_local_pathinto your /etc/rc.local and then checking the file after it's been run on startup. – RaisinBranCrunch Dec 31 '16 at 6:44rc.localfile! – totymedli Jan 30 '17 at 14:02sudo systemctl enable rc-local.serviceto ensure that/etc/rc.localis executed during the server startup – William Nov 17 '17 at 10:36