ca::ctrlaltdel:/sbin/shutdown -t3 -r now # When our UPS tells us power has failed, schedule a shutdown for 2 minutes. pf::powerfail:/sbin/shutdown -f -h +2 “Power Failure; System Shutting Down” # If power was restored before the shutdown, cancel it. pr:12345:powerokwait:/sbin/shutdown -c “Power Restored; Shutdown Cancelled” # 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 # xdm is now a separate service x:5:respawn:/etc/X11/prefdm -nodaemon Note The comments in this sample file were edited slightly to better fit on a book page. They are a reduced version of the actual comments from the Red Hat inittab file. Understanding Runlevels To understand the init process and the inittab file, you need to understand runlevels, which are used to indicate the state of the system when the init process is complete. There is nothing inherent in the system hardware that recognizes runlevels; they are purely a software construct. init and inittab are the only reasons why the runlevels affect the state of the system. Because of this, the way runlevels are used varies from distribution to distribution. This section uses Red Hat Linux as an example. The Linux startup process is very similar to the startup process used by System V Unix. It is more complex than the initialization on a BSD Unix system, but it is also more flexible. Like System V, Linux defines several runlevels that run the full gamut of possible system states from not-running (halted) to running multiple processes for multiple users. The comments at the beginning of the sample inittab file describe the runlevels: Runlevel 0 causes init to shut down all running processes and halt the system. Runlevel 1 is used to put the system in single-user mode. Single-user mode is used by the system administrator to perform maintenance that cannot be done when users are logged in. This runlevel may also be indicated by the letter S instead of the number 1. Runlevel 2 is a special multiuser mode that supports multiple users but does not support file sharing. Runlevel 3 is used to provide full multiuser support with the full range of services. It is the default mode used on servers that use the “text only” console logon. Runlevel 4 is unused by the system. You can design your own system state and implement it through runlevel 4. Runlevel 5 initializes the system as a dedicated X Windows terminal. This runlevel is widely used as an alternative for systems configured to launch an X desktop environment at startup. In fact, runlevel 5 is the default runlevel for most Red Hat systems because most systems are desktop clients that use an X Windows console logon. Runlevel 6 causes init to shut down all running processes and reboot the system. All of the lines in the inittab file that begin with a sharp sign (#) are comments. A liberal dose of comments is needed to interpret the file because the syntax of actual inittab configuration lines is 26
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp hosting services