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.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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/?
Eg
Code:
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
Code:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.