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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.