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.
Adding it to rc.local is a perfectly valid (and simple) way to start it, but note that this will always be started regardless of the runlevel.
The “better” way is to create a script in /etc/init.d that starts the daemon if called with the command-line option “start”, stops it with “stop”, restarts it with “restart”, or reloads it (signals it to re-read its configuration files, if any) with “reload”. You can then create a symbolic link to this script in each of the various runlevel directories, of this form:
Where: X is the runlevel (one symlink for each runlevel) S means start the daemon on entering this runlevel (replace with K to stop the daemon instead) YY is a number; daemons are started/stopped in the order when sorted by this number name is the name of the script to start/stop the daemon
The only real advantage of the latter approach is that you can then use the YaST's runlevel editor to start and stop the daemon.
It's a configuration, a list of services running. You can have many runlevels in your system (plus special ones for reboot, for example), so different configurations you can switch between. You can see a list in /etc/inittab (comments at the beginning of the file).
Ok, so I see there's a startup script for Apache in '/etc/init.d/rc3.d' called 'S02httpd', would 'rc3.d' be right right place to put a startup script for thttpd? What is the difference between the runlevels?
The script in /etc/init.d/rc3.d is probably just a symlink to one in /etc/rc.d/init.d. Directories like rc3.d are places where runlevel configuration is kept. 3 means it's runlevel 3. If you use that runlevel and wish to run thttpd on it, copy/symlink your starting script. To see your current runlevel run 'runlevel' command.
What's the difference between runlevels? Browse /etc/init.d/rc2.d, rc3.d etc. You should see different sets of scripts. That's the difference. The services started at boot at a certain runlevel. I may add that you can completely reconfigure them to suit your needs.