Operate running Systems Flashcards Preview

Rhcsa > Operate running Systems > Flashcards

Flashcards in Operate running Systems Deck (67)
Loading flashcards...
1

multiple ways to reboot a system

# reboot
# shutdown -r now
# sudo init 6
# telinit 6
# shutdown -r +3 reboot after 3 minutes
# shutdown -r 10:35 reboot at 10:35

2

Multiple ways to shutdown a system

# shutdown -h now
# sudo init 0
# sudo telinit 0
# poweroff

3

Boot Process

1. Bios initializes
2. Bootloader is then called by the Bios
3. Bootloader loads the first kernel image
4. Kernel then mounts file systems and starts the appropriate system services.
5. The system services finish starting up, and a login screen is presented

4

BIOS

- Basic Input Output System
- installed on a small chip on the motherboard
- initializes basic peripherals on the system, sets the system clock, and searches for the boot device
- once boot device is detected, the program installed(known as bootloader) is executed

5

BootLoader(GRUB)

- Default RHEL bootLoader is GRUB
- GRUB loads the first kernel image listed in its configuration file
- Then hands control of the rest of the boot process to the Linux kernel

6

Kernel boot process

- Kernel detects hardware on the system
- Kernel loads device drivers from its initial RAM file system initramfs-.img
- Mounts the root file system in read only mode
- init is then loaded(starts the init process)

7

Last stages of startup

- init runs the necessary scripts in /etc/init
- /etc/inittab is read for the default runlevel
- runlevel scripts for the appropriate runlevel are started
- user is presented with a login screen

8

Runlevels

0, shutdown
1, single: Maintenance level
2. level without some network resources(for example lack of NFS)
3. Multi-user level without graphical interface
4. None
5. Multi-user level with graphical interface
6. reboot

9

to check current run level

# runlevel

10

to change current run level

# init x
# telinit x

11

Boot into different run level at boot time

Press the letter i when you see the bootloader. At the grub menu press the a key to append an argument to the kernel boot line. Enter argument at the end of the parameter, then press enter.

12

upstart

-Originally developed for Ubuntu
- replaced the old system V init System
-SysV init started services Sequentially
- Upstart starts services in parallel
- Provides a much faster boot experience
- Review man 5 and man 8 for upstart

13

init

- init is the first process (PID 1)
- All other processes are child process from init
- /sbin/init
- configuration files for init|upstart are in /etc/init

14

rcs.conf

- /etc/init/rcs.conf
- Primary script that gets called from Upstart
- first it executes /etc/rc.d/rc.sysinit script
- reads /etc/inittab for default run level
- finally it switches to default runlevel

15

rc.sysinit

- /etc/rc.d/rc.sysinit
- sets system hostname
- starts networking
- Mounts and checks file Systems
- runs plymouth
- sets SELinux state
- send messages to /var/log/dmesg

16

Plymouth

provides the progress bar that we see during system bootup

17

inittab

-/etc/inittab
- Used to be the main script file that init uses during system startup
- it has been demoted with RHEL6 with upstar
- sets the default system runlevel

18

rc.conf

- /etc/rc.conf
- called by the /etc/init/rcs.conf file, uses default runlevel as set in /etc/inittab
- fires up the scripts located in /etc/rc.d/rcx.d/ (where x is the default runlevel)

19

some important startup scripts

- /etc/sysconfig/init
--- sets colors for plymouth, determines if single user mode will need a password or not etc.
- /etc/init/tty.conf
---creates terminals accessed through ctrl + alt + F1 - F6

20

/etc/rc.d/rcx.d

check which scripts are run in different run level. Replace x for 0 - 6

21

K vs S before service startup scripts

K is for kill and the S is for start

22

chkconfig

use chkconfig to start or kill services at startup
# chkconfig servicename on
# chkconfig servicename off
# chkconfig --list servicename check if service name is on or off
# chkconfig --level 35 atd on allow a service to start at specific runlevel(3,5)

23

Cancel schedule shutdown

# shutdown -c

24

top command

display an instantaneous image of a server's activity

25

to get details about process

# ps -edf

26

to start a process with a low priority

# nice - n 10 ./script.sh

27

To change the priority of an already running process

Get the process's PID (example using PID 789( then type):
# renice +5 789
Alternative way
# renice +5 `pgrep script.sh`

28

Killing processes

# kill -9 789 PID 789
# pkill script.sh
#killall httpd

29

display details about IO activities

# iostat

30

display network card activities

# netstat -a