Execute script on boot
Hi i have a simple question. I wrote a script that I want to execute when the machine boots up. It boots into run level 3 but I figured I could put the command in /etc/rc.d/rc.local. So I put in "./usr/local/sbin/update" Where the update is my script. I don't think this is getting run when I boot up so what am I doing wrong? How do I execute the script properly since the ./ probably isn't correct. Thanks!
|
*edit*
Damnit, where's that delete button? |
You can add stuff to rc.local, but the commands need to be either found on the path that is set during system boot or to use an absolute path. You're using a relative path (the . says relative to the current directory). Try it as just /usr/local/sbin/update
|
Thanks! Yea I didn't need that dot there. Also I needed to chmod +x update. Forgot that it needs to be executable for all before it can be run.
|
Also, make sure your script is executable (chmod +x /usr/local/sbin/update)
|
All times are GMT -5. The time now is 02:32 AM. |