Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I have a startup script that i put in /etc/init.d
i have a symbolic link in r3.d
When i reboot the system, the process generated by the script are not running.
i can execute the script at /etc/init.d
Pls kindly assist
What is the default runlevel for your system? Look in /etc/inittab for the line like "id:5:initdefault:". Mine here is set to boot to runlevel 5. If it isn't 3, then you might not be running your script. In my case, scripts on rc5.d will be run, but not rc3.d.
Check the man page for chkconfig to see who you can use it to control the execution of scripts in /etc/init.d.
Read the manpages for chkconfig (if your system has it) and insserv. Also look for a skeleton script. The comments at the beginning of startup scripts are important and contain info on which runlevels the stript should start in and which services need to be running before the script.
The script needs a line at toward the start, that tells chkconfig how the script should be started - i.e. in which runlevels, and at what priority it should be started and stopped. This can look like this:-
# chkconfig: 2345 99 00
From the man-page for chkconfig:-
Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The
first line tells chkconfig what runlevels the service should be started in by default, as well as the start and stop
priority levels. If the service should not, by default, be started in any runlevels, a - should be used in place of the
runlevels list. The second line contains a description for the service, and may be extended across multiple lines with
For example, random.init has these three lines:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.
This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and
that its stop priority should be 80. You should be able to figure out what the description says; the \ causes the line
to be continued. The extra space in front of the line is ignored.
I suggest you consider when you want the script to start and stop, add the appropriate line to it, and run chkconfig again to ensure it will run at boot time.
Now, assuming that the script is starting and stopping correctly, and it still isn't working, add some debugging statements (e.g. "echo I'm about to start the process >> /var/log/script.log", and "echo "The process should now be started >> /var/log/script.log") to the script so that you can see what it is doing when it is called during startup and shutdown.
I have found what's the issue for the startup script. I have a variable in my .bashrc (i'm using root) which is $RMDS_SW= /software/rmds
when i startup the system, it doesnt seems to export this variable and therefore my startup script couldnt navigate to the correct path to run the command.
How do i set this in the system environment? Thanks.
BTW, what's the different in putting under .bashrc and .bash_profile?
appreciate any help