CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
  • Week 1
    • 1.Operating Systems and Linux: What the Kernel Does
    • 2.Free Software and Distributions: The Ecosystem Built by Licenses
    • 3.Installation and Booting: From the Moment You Power On
    • 4.Filesystem Structure and File Types: Everything Is a File
    • 5.Week 1 Comprehensive Review: Time to See Through the Concepts
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
    • 1.Process Management: From PIDs to Signals and Priorities
    • 2.Daemons and the Process Life Cycle: From fork and exec to Zombies and Orphans
    • 3.System Initialization: From init and Runlevels to systemd and Targets
    • 4.Job Scheduling: From cron's 5 Fields to at and batch
    • 5.Week 6 Comprehensive Review: Tying Processes, Initialization, and Scheduling Together on One Page
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
  • Week 13
  • Week 14
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← Linux Master 1/Week 6/Day 5

Based on the Linux Master 1 exam syllabus·Report an error

Linux Master 1· AssociateWeek 6 · Day 5~25 min read

Day 5 - Week 6 Comprehensive Review: Tying Processes, Initialization, and Scheduling Together on One Page

📌 Key Takeaways

  • This week in one sentence: Linux's dynamic world starts from a single process (PID 1), grows into a tree, talks through signals, and works according to a timetable (cron).
  • Viewing: ps aux (usage, bare) / ps -ef (PPID, hyphen); controlling: signal order 15 → 9. Only 9 and 19 cannot be blocked, and negative nice is root-only.
  • The life cycle is fork (new PID) → exec (PID kept). Zombie = dead child + parent that doesn't collect it (dangerous), orphan = living child + dead parent (adopted by PID 1, harmless).
  • Initialization is all about the runlevel ↔ target mapping — 2, 3, 4 → multi-user, 5 → graphical, 0 and 6 are forbidden as defaults. start (now) and enable (every boot) are separate.
  • Scheduling uses the "min-hour-day-month-weekday" 5 fields (weekday 0 and 7 = Sunday), and a system crontab adds a user field for 6 fields. cron = recurring, at/batch = once.

Review of Process Identification and Control (Day 1)

ToolPurposeKey point
ps auxAll + usageNo hyphen, %CPU/%MEM
ps -efAll + PPIDWith hyphen, tracing parents
top/htopReal timetop is built in, htop must be installed
pgrep/pstreeSearch by name / treeAvoids grep self-reference, visualizes hierarchy
  • Signals are the only means of talking to a process. Memorize the numbers.
NumberNameMeaningCan be blocked?
1SIGHUPRe-read config (reload)Yes
2SIGINTCtrl+C interruptYes
9SIGKILLForced termination (immediate)No
15SIGTERMGraceful termination (kill default)Yes
19SIGSTOPStopNo
  • Priority is set with the nice value (-20 to 19, default 0). Lower means higher priority, negative is root-only, nice is for launch time and renice for running processes.

⚠️ Trap review: Don't mix ps aux (bare) and ps -ef (hyphen). Terminate in the order 15 (graceful) → 9 (forced). Only 9 (SIGKILL) and 19 (SIGSTOP) cannot be blocked. Negative nice is root only. kill works by PID, killall/pkill by name.

Review of the Process Life Cycle (Day 2)

  • A new process is born by fork (copy) → exec (replace). fork creates a child with a new PID, and exec keeps the PID and changes only the program.
  • Job control: & (background), Ctrl+Z (stop), bg, fg, jobs, nohup.
  • Zombies and orphans are exact opposites.
CategoryZombieOrphan
ChildDead (Z, defunct)Alive
ParentAlive but doesn't waitTerminated first
PPIDOriginal parentAdopted by PID 1
DangerOccupies a PID (dangerous)Harmless
FixTerminate/restart the parentPID 1 reaps it automatically

⚠️ Trap review: "Zombie = dead child + parent that doesn't collect it, orphan = living child + dead parent (adopted by PID 1)". A zombie can't be killed with kill -9; you have to deal with the parent. Ctrl+Z is a stop (T), not termination. exec doesn't create a new process (PID kept).

Review of System Initialization (Day 3)

  • The runlevel ↔ target mapping is the key.
Runlevelsystemd targetMeaning
0poweroff.targetHalt
1rescue.targetSingle-user (rescue)
2·3·4multi-user.targetText multi-user
5graphical.targetGUI
6reboot.targetReboot
  • The start/enable distinction in systemctl is important.
CommandMeaning
start/stopTurn on/off immediately
enable/disableRegister/unregister auto-start at boot
enable --nowRegister + start immediately
statusCheck active (running) and enabled (auto) at once

0 and 6 are forbidden as the default runlevel. 2, 3, and 4 are all multi-user.target. start (once, now) and enable (auto at boot) are separate. daemon-reload is required after editing a unit file. [Install] WantedBy= is the target that enable links to. Logs: journalctl -u service -f.

Review of Job Scheduling (Day 4)

  • crontab 5 fields: minute (0-59) hour (0-23) day (1-31) month (1-12) weekday (0-7, 0·7=Sun).
  • Build patterns with the symbols * , - /, and specifying both day and weekday is OR.
ToolCountWhenDaemon
cronRecurringFixed intervalcrond
atOnceSpecified timeatd
batchOnceWhen load is lowatd
ItemUser crontabSystem crontab
Fields5 fields + command5 fields + user + command (6)
Managementcrontab -e/-l/-r/etc/crontab, /etc/cron.d/

The order is "min-hour-day-month-weekday". Weekday 0 and 7 = Sunday. A user crontab has 5 fields, /etc/crontab has 6. cron = recurring, at/batch = once. allow > deny in priority. crontab -r deletes everything, so be careful. The at list is atq, deletion is atrm.

Scenarios That Often Intertwine — Integrated Thinking

Scenario A — Safely terminating a runaway process

ps aux --sort=-%cpu | head      # identify the process hogging the CPU
pgrep -l runaway                # get the exact PID
kill -15 1234                   # try graceful termination first
kill -9 1234                    # force termination if that doesn't work
  • Integrates Day 1 (ps, pgrep, signals 15 → 9).

Scenario B — Registering a new service + auto-start + checking logs

vi /etc/systemd/system/myapp.service   # write the unit file
systemctl daemon-reload                # make systemd notice the change (required)
systemctl enable --now myapp           # register + start immediately
systemctl status myapp                 # check active/enabled
journalctl -u myapp -f                 # follow logs in real time
  • Integrates Day 3 (unit, daemon-reload, enable, journalctl).

Scenario C — Automating a daily backup at dawn

crontab -e
# 0 3 * * * /usr/local/bin/backup.sh   # every day at 3 a.m.
crontab -l                             # confirm registration
  • If the backup script is heavy, yield with nice or run it with batch when the system is idle — integrates Days 1, 2, and 4.

The standard flow of real-world incident response is exactly this order — find the culprit with ps/top (Day 1), stop it safely with signals 15 → 9 (Day 1), restart the service cleanly with systemctl (Day 3), check the cause in the logs with journalctl (Day 3), and set up an inspection job in cron to prevent recurrence (Day 4). This week's content is the backbone of real-world operations, not just of the exam.

📖 Glossary

  • PID 1 : The first process the kernel starts (init/systemd). The ancestor of all processes, the star of initialization, and the adopter of orphans.
  • Signal : A numbered notification sent to a process. 1 HUP (reload) · 2 INT (Ctrl+C) · 9 KILL (forced) · 15 TERM (default) · 19 STOP (stop).
  • Unblockable signals : 9 (SIGKILL) and 19 (SIGSTOP). A process cannot catch or ignore them.
  • Nice value : A value from -20 to 19 indicating how much CPU a process yields. Lower means higher priority, and only root can give negative values.
  • fork / exec : Copying itself to create a child with a new PID / keeping the PID and swapping out only the executing code.
  • Zombie / orphan : A dead child the parent hasn't collected (Z, dangerous) / a living child adopted by PID 1 after its parent died first (harmless).
  • Runlevel ↔ target : SysV's 0-6 states and systemd's bundled-state units. 2, 3, and 4 merge into multi-user, and 5 into graphical.
  • start vs enable : Turning on once now / registering to turn on automatically at every boot. enable --now does both.
  • daemon-reload : A command that makes systemd re-read the disk contents after you edit a unit file. If you forget it, the service runs with the old settings.
  • crontab 5 fields : minute-hour-day-month-weekday. Memorize it as "min-hour-day-month-weekday", and for the weekday both 0 and 7 are Sunday.
  • at / batch : Run once at a specified time / run once when the system load drops. Both are handled by the atd daemon.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

Which command is most appropriate for checking all processes together with the parent process (PPID) column?

Question 2

Which pair of signals below cannot be caught or ignored by a process and therefore always takes effect?

Question 3

When you give the kill command only a PID with no option, which signal is sent by default, and what is its nature?

Question 4

Which of the following is correct about the nice value?

Question 5

Which of the following correctly describes the difference between a zombie process and an orphan process?

Question 6

What is the result of pressing Ctrl+Z during a foreground job?

Question 7

In a systemd environment, which target corresponds to the old runlevel 3 (text multi-user)?

Question 8

What is the result of running only systemctl enable sshd without start?

Question 9

Which command must you run right after creating or editing a systemd unit file?

Question 10

When does the crontab entry 0 9 * * 1-5 /work.sh run?

Question 11

Which of the following is correct about the format difference between a user crontab and a system crontab (/etc/crontab)?

Question 12

Which of the following is correct about cron, at, and batch?

PreviousJob Scheduling: From cron's 5 Fields to at and batchWeek 6 · Day 4Next Package Management: RPM/YUM/DNF and DEB/APT, Both Families at a GlanceWeek 7 · Day 1

Official references

  • Linux Master 1 official exam syllabus(opens in a new tab)

On this page

  • Key Takeaways
  • Review of Process Identification and Control (Day 1)
  • Review of the Process Life Cycle (Day 2)
  • Review of System Initialization (Day 3)
  • Review of Job Scheduling (Day 4)
  • Scenarios That Often Intertwine — Integrated Thinking
  • Glossary
  • Practice Questions