Presentation is loading. Please wait.

Presentation is loading. Please wait.

Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes.

Similar presentations


Presentation on theme: "Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes."— Presentation transcript:

1 Starting and Stopping Linux

2 Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes peripherals, loads drivers, mounts root file system –Calls /sbin/init Spawns user level processes –Reads /etc/inittab –Other scripts kicked off from inittab Distribution specific operations –Red Hat /etc/rc.d/rc.sysint /etc/rc3.d or /etc/rc5.d (runlevel)

3 Run Levels Common scheme –0Halt –1single user –2-5multi-user –6reboot Red Hat –0Halt –1single-user text –3multi-user text –5multi-user graphical –6reboot

4 Runlevel /sbin/runlevel –Determines the run level –N 5 “N” means you haven’t previously booted to a different runlevel –/sbin/init 3 Change your runlevel. You must be root –/sbin/init 1 Single user, text, root shell

5 Why init? Init 1 –Troubleshoot and repair Stop/repair when normal methods fails Restart/switch services End an X session

6 Changing the default runlevel /etc/inittab id:2:initdefault –change “2” to the desired runlevel Comment line out –Prompted for runlevel at startup

7 Stopping X startx is the command –When you ‘log out’, X stops

8 Managing runlevels Red Hat –chkconfig command Allows you to turn services on, off for one or more runlevels Allows you to add, delete services for one or more runlevels –Chkconfig - - level 2345 ssh on –Chkconfig - - add ssh xinetd services turned on/off with chkconfig (all levels) chkconfig - - list

9 Try it… List all the services running on the system You can specify listing the status of a single service as well –Just list the service in the command chkconfig - - list syslog

10 ln command –Create a softlink to configure a service in a runlevel #ln –s /etc/rc.d/init.d/cups/etc/rc.d/rc3.d/S90cups Create the link for all runlevels –Including the “kill” level! #ln –s /etc/rc.d/init.d/cups/etc/rc.d/rc0.d/K01cups

11 Running and stopping services /init.d –Contains scripts Read the script (for options) # /etc/init.d/networking –To stop networking: # /etc/init.d/networking stop

12 Shutting down Linux Shutting down (must be root) # shutdown –h now # poweroff # halt # shutdown –h +6 “System coming down in 6 minutes” Cancel the shutdown # shutdown –c Reboot # shutdown –r now # reboot

13 Ctrl-Alt-Delete Disable the 3-finger reboot –Comment out the line in /etc/inittab # ca:12345:ctrlaltdel:/sbin/shutdown –t1 –r now –To allow for a set of users Add the –a switch # ca:12345:ctrlaltdel:/sbin/shutdown –t1 –a –r now –Then add list of allowed users to /etc/shutdown.allow

14 Shutting down automatically Use the crontab /etc/crontab Add a line: #mhdommondowusercommand 0023***root/sbin/shutdown – h now


Download ppt "Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes."

Similar presentations


Ads by Google