Java Reference
In-Depth Information
# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
NOTE
Some Linux distributions run different scripts for each runlevel instead of passing
the runlevel as an argument to a single script. The details are not important.
The net effect is that a script is run for each runlevel.
Sure, you could put the code to run JBoss directly in that script if you
want. But these scripts have been designed to handle arbitrary sets of services
without you having to modify those scripts directly. How? By doing what Linux
(and its UNIX antecedents) does so well: making complex systems out of
simple parts.
Each service you might wish to start and stop gets a shell script that con-
trols it. This shell script must take a command argument. The minimum set
of commands that must be supported are start and stop . Other options such
as restart and status are often supported, but start and stop are the
important ones.
The script for atd , the one-shot job scheduler, is a fine example. Let's take
a look at it (Example 20.2).
Example 20.2 The atd init shell script
#!/bin/bash
#
# /etc/rc.d/init.d/atd
#
# Starts the at daemon
#
# chkconfig: 345 95 5
Search WWH ::




Custom Search