Boot script
OK I'm new to Linux but know my way around a PC and various languages, however, I cannot figure out how to run something at boot (before user login)
I have tried a few things but nothing quite works so I thought i would ask here Hardware beagle Bone Black with Debian wheezy Thanks P.S. Ideally I would like to run a python script Steve |
There are several boot levels depending on when you want your script to start.
this may help you a bit, as you might forget googling before asking.. http://www.cyberciti.biz/tips/linux-...-boots-up.html |
Thanks yooy,
I did Google first, but Google can be confusing when you are not sure about the subject. Steve |
OK, I made a script in /etc/init.d/ called mystartup.sh (see below)
then "sudo chmod +x mystartup.sh" (whilst in /etc/init.d/ directory) ran "sudo upate-rc.d mystartup.sh defaults 100" Rebooted and nothing :-( ### BEGIN INIT INFO # Provides: mystartup # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: No comment yet # Description: No comment yet ### END INIT INFO #!/bin/bash echo "something" |
Hi,
as far as I can see, what you described should work. Can you confirm that there really is a sybolic link to your script in /etc/rc2.d/? Eg Code:
ls -l /etc/rc2.d/*mystartup.sh Code:
date > /tmp/mystartup.txt Evo2. |
Only thing I see wrong is that the #!/bin/bash line must be first...
|
It Works!
Thanks guys it now works, I moved #!bin/bash line and did date to file and file was there.
Now if I change the script to run a python script will it launch the script once at boot or for each terminal session I start? Steve P.S. Is there anything I should understand about running python scripts from shell scripts? |
If it is in /etc/init.d and specified to be started, only once per boot. It will also be invoked at shutdown.
|
Brain skip.
|
Hi,
Quote:
Evo2. |
All times are GMT -5. The time now is 09:00 PM. |