DECK 3 Flashcards

1
Q

dnf group list= shows all groups
dnf group info “groupname” ?

dnf transactions are logged to /var/log.dnf.rpm.log
dnf history undo undoes a transaction. Might not always be successful.

subscription-manager register registers a system? how to unregister?

put….at the end to get entitlement certs and access to repos. Its the final step

A

-info on specific group

-unregister

-attach

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

command & starts a job in background

move job to back background: first, Ctrl+Z to stop it, then…to move to background

jobs= shows all running jobs and their numbers ex: [1], [2] etc

fg (job number)=

A

-bg

-moves job back to foreground

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

WAITING PROCESS STATES:

task_interruptible (S): waiting for request or signal
task_uninterruptible (D): waiting but doesn’t respond to signals
task_killable (K): waiting, can be killed
task_report_idle: kernel threads, doesn’t count for load average. ignore

EXIT STATES:

  1. ZOMBIE (Z)+ signals parent it’s exit and releases all resources EXCEPT PID
  2. Next stage= EXIT_DEAD (X)= all remaining processes cleaned up
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ZOMBIES DONT NEED TO BE KILLED. But…

  1. use…..to ask parent to reap Zombie’s status
  2. kill parent
A

-they occupy PIDS. Disadvantageous.

SIGCHLD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

HOW A REPO FILE SHOULD LOOK EX:

[baseos]
name=BaseOS
baseurl=file:///repo/BaseOS
gpgcheck= 1 or 0 (depends on what’s being asked)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ps -fax= show hierachy between processes
ps -fU user = shows all processes owned by a user
ps -f –forest -C sshd= shows process tree for a specific process

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

free -m shows current memory usage
more detail seen in /…/meminfo

swap is disk space pretending to be RAM

memory usage can be changed in kernel parameters at boot: press e for edit, go to end of line that starts with ‘linux’, and after ‘quiet’ put…

A

-proc

-mem=#G #= a number you put. Ex. 1G, 3G

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When writing files, might want to use ‘sync’ command to commit file to disk IMMEDIATELY to make sure it doesn’t disappear on reboot.

…..periodically commits write cache to disk

uptime checks cpu load

…..shows # of cpu cores

A

-pdflush

-lscpu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

top show current system activity

ps aux | grep…. identifies zombies

CPU info in TOP: us = % of processes used by users, sy = % that is kernel processses, wait= system waiting for IO. Could be bad if its high, id = percent of time system is idle

load average higher than the number of cores is BAD

A

-defunct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

signals allow OS to interrupt a process. man 7 signals documents signals

….command sends signals to PIDS. k can be used from top to do this as well

sigkill is a normal kill. …..is forceful kill

killall kills processes by name

A

-kill

-sigterm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

STEPS TO KILLING A ZOMBIE

  1. identify it with ps aux | grep defunct
  2. use ps fax | less to find parent
  3. use kill -SIGCHLD with number of parent
  4. kill parent with kill and number of parent
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SYSTEM TUNING

Swappiness is set in /proc/sys/vm/swappiness

use cat to view it, then echo # > /proc/sys/vm/swappiness to change it

-make it persistent by writing to …… This file also manages many kernel tunables

SWAPPINESS WON”T OPEN IN EDITORS!!!!

A

/etc/systl.d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

use sysctl and whatever tunable to find it’s value

CHANGE SWAPPINESS TUNALBE

first, go to sysctl.d directory

use cat&raquo_space; swappiness.conf «EOF
> vm.swappiness = #
>EOF

to change swappiness tunable

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

sysctl -a shows all tunables

difference between swappiness.conf and vm.swappiness?

tuned = systemd service, work with different profiles

tuned-….list= show current profiles

A

-swappiness.conf is PERSISTENT, vm.swappiness is NON-PERSISTENT

-adm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

tuned-adm profile virtual-guest = sets another profile as default

reapply_sysctl = 1 or 0 parameter in /etc/tuned/tuned-main.conf does what?

A

-if at 1= sysctl parameter wins, 0= tuned wins

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

CREATE A TUNED PROFILE

  1. make a directory: mkdir /etc/tuned/myprofile
  2. cat&raquo_space; /etc/tuned/myprofile/tuned.conf «EOF
    >[ sysctl ]
    >vm.swappiness = 66
    >EOF

profile should now show up in tuned-adm list. Keep in mind it won’t apply irf reapply sysctl set at 1

A
17
Q

ps -u user = shows processes owned by user

pkill -u user = kills user processes

…….is part of systemd and manages users and sessions

loginctl list-users and loginctl list-…..=shows users and sessions

loginctl terminate-session and loginctl terminate-user username do just those things

A

-loginctl

-sessions

18
Q

passwd -u user =

passwd -l user = locks account

IF YOU SEE AN ! mark when viewing an account in /etc/shadow for a user it means the user is locked

nice -n 10 command =

ordinary user’s can’t nice to a higher priority.

A

unlocks an account

lowest nice priority for a command

19
Q

……..is first process after loading kernel

systemctl list-units -t timer =

systemctl list-units -files =

difference between systemctl start/stop and systemctl enable/disable?

systemctl reload= reloads but doesn’t…

systemctl restart= restarts and gives a new PID

A

-systemd

=shows active timer units
=shows all unit files and states (enabled, disabled, static etc)

-former is not persistent, latter is

-restart

20
Q

MODDING SYSTEMD UNITS

  1. use systemctl edit nameofservice.service to edit unit files
  2. use systemctl show to see params
  3. maybe use systemctl reload

systemctl mask service = mask a service. stops it from starting. Need to stop it from running first

systemctl umask serivce = unmask a service. Need to start it to make it run again

A
21
Q

systemctl list-unit-files –state=masked =

A

-shows all masked files