Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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
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/?
ls -l /etc/rc2.d/*mystartup.sh
I'm assuming you didn't change the default run level. Also, if all your script does is echo a single string then you might miss seeing it during the boot. Pheraps you could make it do something else that is easier for you too see. Eg
date > /tmp/mystartup.txt
This just creates a text file containing the date and time it was run. Then after the machine has booted you can look for the existence of the file /tmp/mystartup.txt
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?
It will run once with the argument "start" each time runlevels 2-5 are entered and each time with the argument "stop" the system exists those same runlevels. The running of the script is not related to starting terminal sessions.