JustAnswer.com

Friday, November 23, 2007

Linux boots

Linux boots



To add a service, you must create a script like the others in the init.d
directory and then make a symbolic link in the correct rc*.d directory.
The easiest way to write a script is to examine the scripts already in init.d,
make a copy of one that you understand, and modify the copy.

When adding a service, make sure that you choose an appropriate place in the boot
sequence to start the service. If the service starts too soon, it may not work,
due to a dependency on some other service. For non-essential services, most systems
administrators prefer numbers in the 90s, after most of the services that came with the system.

Linux distributions usually come with a command to enable and disable services in the
rc*.d directories. For example, in Debian, the command is update-rc.d, and in Red Hat Linux,
the command is chkconfig. Graphical user interfaces are also available. Using these programs
helps keep the startup directories consistent and helps with upgrades.

HINT: One of the most common Linux installation problems is an improperly configured
XFree86 server that flicks on and off, making the system unusable on console.
To stop this behavior, boot into single-user mode and alter your runlevel or
runlevel services. Look for something containing xdm, gdm, or kdm in your rc*.d directories, or your /etc/inittab.





Occasionally, you need to give init a little kick to tell it to switch runlevels,
to re-read the inittab file, or just to shut down the system. Because init is always the first process on a system,

its process ID is always 1.

You can control init with telinit. For example, if you want to switch to runlevel 3, use this command:

telinit 3

When switching runlevels, init tries to kill off any processes that aren't in the
inittab file for the new runlevel. Therefore, you should be careful about changing runlevels.

When you need to add or remove respawning jobs or make any other change to the inittab file,
you must tell init about the change and cause it to re-read the file. Some people use
kill -HUP 1 to tell init to do this. This traditional method works on most versions of Unix,
as long as you type it correctly. However, you can also run this telinit command:

telinit q

You can also use telinit s to switch to single-user mode.

1 comment:

Akulkis said...

Fuck off, and quit spamming mailing lists, you asshole.