Lesson 8: Managing System Components Flashcards
What powers the GUI?
The “compositor” in conjunction -> with X-server to GUI -> (x client/ web browser, x client graphics, x client terminal )
What is the most common user interface?
GNOME then KDE
How do you install additional user interface
yum groupinstall “{UI_name}”
How do you switch UI experience?
On the log in screen click settings (gear)
How are services controlled ?
The linux kernel starts up it launches the init (older sysvinit now systemd) which starts and manage service.
How would you verify if system is using systemd?
Run the command ps (process show)
-aux option shows all processes with user attached
View process PID number 1 which should show systemd
Or check /sbin/init folder
What happens after systemd loads?
It parses the unit files in the /lib/systemd/system directory
Where show you make changed to unit files?
In the /etc/systemd/system directory which will overwrite what is done in the /lib/systemd/system
What command enables you to control the systemd init daemon?
system control utility, The syntax of the systemctl command is systemctl [options] [subcommand] [arguments]
Subcommand:
status {service} Retrieve the current status of a service.
enable {service} Enable a service to be started on boot.
disable {service} Disable a service so that it is no longer started onboot.
start {service} Start (activate) a service immediately.
stop {service} Stop (deactivate) a service immediately.
restart {service} Restart a service immediately.
set-default {target} Set the default target for the system to use on boot.
isolate {target} Force the system to immediately change to the provided target.
mask {unit file} Prevent the provided unit file from being enabled or activated, even when done manually.
daemon-reloadReload the systemd init daemon, including all unitfiles.
Options:
- t {unit file type} Specify the unit file types to perform the operation on.
- aList all unit files or properties, regardless of state.
- -no-reload Prevent the reloading of configuration changes when enabling or disabling a service.
- -no-ask-password Prevent users from being asked to authenticate when performing privileged operations.
- -runtime Make changes temporary so that they will not be present after a reboot.
- H {remote host} Execute the operation on the remote host specified by IP address or hostname.
- -no-pager Prevent the output from being piped into a paging utility.
How does systemd keep track of which services need to run?
It looks at the .target files, which defines what is going to get started up
What is the first script SysVinit run?
it runs the rc.init script. The path is /etc/rc.d/rc.init
How many run levels are there and what are they?
There are 7:
rc0. d - sys shut down
rc1. d through rc5.d run cat /etc/inittab to check distro docs
rc6. d - sys reboot
Default options:
rc1 - Single user mode (one user can be logged into system)
rc2 - multiuser, without NFS (without networking functions)
rc3 - Full multiuser mode (boots in cmd line interface allows multiple connections, most server run this mode)
rc4 - unused (usually for custom run level)
rc5 - X11 (boots to graphical user interface)
What is the rc.local file?
rc.local is the last script that will be ran in sysvinit and might override others
How do you manipulate what run level a service runs on?
Use chkconfig, which allow you to turn services on or off for different run levels. It defaults to levels 3 and 5.
chkconfg {service_name} {turn “on” or “off”}
chkconfg {service_name} –level {specify levels} {turn “on” or “off”}
How do you list services and which levels they are going to execute at?
chkconfig –list
chkconfig command is chkconfig [options] [service] [subcommand]
Options:
{service} on Enable a service to be started on boot.
{service} off Disable a service so that it is no longer started on boot.{service} reset Reset the status of a service.
–level {runlevel} Specify the runlevel in which to enable or disable aservice
How do you start a service?
Use the services command - service {service_name} start
The syntax of the service command is service [options] [service] [subcommand]
Subcommand:
{service} status Print the current state of a service.
{service} start Start (activate) a service immediately.
{service} stop Stop (deactivate) a service immediately.
{service} restart Restart a service immediately.
{service} reload Re-read a service’s configuration files while the service remains running.
How do you check a service status?
User the service command - service {service_name} status
How do you make temporary changes to which run level your system boots up to?
run init {run_level_number}
note. you can use the who command to see who is logged into the system before making changes
What are the five different states of the processes life cycle?
application gets executed and starts running
Waiting or Sleep interruptible (can wake for several reasons such the resource coming available)
Waiting or Sleep uninterruptible (sleeps for
a time)
Zombie (parent hasn’t cleared it to stop)
Stops
How do you tell if a process is not working correctly ?
top command will show you the top resource consumer in system by default it will sort to CPU consumption
cap M will sort by memory cap P will sort by CPU u {user_name} will show processes that specified user is using k {process_ID} will kill a process q to quit
what command will help troubleshoot systemd processes at boot up
systemd-analyze helps you troubleshoot systemd on your system
-blame looks at at resource caused system to boot slow
How would you list open files?
Yes the command lsof
lsof | grep {resource_name}
What is the command jobs?
command jobs shows processes placed to run in back
Use & to place job in background
% {job_number} to reopen a
background command bg {job_number} starts a job that has been placed in the background
foreground command - fg {job_number}
How would you manage processes prioritize?
niceness value range from -20 to 19 where -20 is the fastest and 19 is slowest
10 is the default
nice -n {value#} {resource}