LFCS 1.2: Processes and services
Signals and nice values, running a service now and at boot, fixing a broken service, masking, and the default boot target.
Before you start
The lab creates user alice (password Lab-Pass-1), installs the cups
print service and starts it, stops and disables any web server already
installed, and sets the default boot target to graphical.target.
Tasks
- As
alice, startsleep 3000in the background, find its PID withoutps, give it nice value 15, then stop it with SIGTERM. Check it yourself:ps -o ni -p PIDshows15before you stop it, andpgrep sleepprints nothing after. - Install nginx (or httpd), and make it run now and at every boot.
- Put a typo in the web server's configuration and restart it. Find the
exact error line in the logs and write it to
/root/lab-answers/3. Then fix the typo, so the service is running again andcurl -sI localhostreturns a status line. - Make sure the
cupsservice can't be started by anyone. - Make the system boot to a text login by default.
Hints
pgrep -u,renice -n ... -p,kill.systemctl enable --now,systemctl is-active,systemctl is-enabled.systemctl status,journalctl -u ... -b,nginx -torapachectl configtest.systemctl mask.systemctl get-default,systemctl set-default.