1.8 KiB
1.8 KiB
Linux+ 5.2.3: Process, package and access problems
A segfault and its core dump, the OOM killer in a memory-limited scope, a stopped process, and the cron PATH problem.
Before you start
The lab makes the journal persistent if it isn't. It starts a service,
queue-worker, that adds one to the number in /var/lib/queue-worker/count
every second, and creates user ops, whose crontab runs a tool from
/usr/local/sbin every minute, logging to /home/ops/labtool.log.
Something is wrong with both. The stopped process doesn't survive a
reboot: do the tasks and check without rebooting. Write answers to the
files in /root/lab-answers/.
Tasks
- Make a process die of a segmentation fault (
bash -c 'kill -SEGV $$'), note its exit code, and find its core dump withcoredumpctl(on Ubuntu, installsystemd-coredumpfirst). - Watch the OOM killer act inside a scope limited to 50 MiB of memory with no swap, and find its message in the kernel log.
queue-workeris running, but the count doesn't go up. Find out why, write the state codepsshows for its process to/root/lab-answers/3, and get it going again without restarting it.- User
ops's cron job fails every minute. Find out why from its log, and fix the crontab entry so that it runs (as userops). Wait for the next run and seelabtool ranat the end of the log.
Hints
echo $?(128 + the signal number),coredumpctl list,coredumpctl info.systemd-run --scope -p MemoryMax=50M -p MemorySwapMax=0 python3 -c ...,journalctl -k --since "-2min" | grep -i -E 'oom|killed'.systemctl status,ps -o pid,stat,cmd -p PID,kill -CONT.crontab -l -u ops,crontab -e -u ops; cron'sPATHis short: use the full path, or setPATH=in the crontab.