LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Execute script on boot (https://www.linuxquestions.org/questions/slackware-14/execute-script-on-boot-410166/)

mustangfanatic01 01-31-2006 06:41 PM

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!

mdarby 01-31-2006 06:47 PM

*edit*

Damnit, where's that delete button?

gilead 01-31-2006 06:56 PM

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

mustangfanatic01 01-31-2006 07:01 PM

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.

odevans 01-31-2006 07:01 PM

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.