1.7 KiB
1.7 KiB
LPIC-1 104.7: The FHS and finding files
Where a service's files live, the locate database and what it leaves
out, and the different ways to look up a command.
Before you start
The lab installs plocate if it's missing, creates /srv/archive/ with a
few old files in it, and builds the locate database. It saves
/etc/updatedb.conf; reset puts it back. Work as root (sudo -i), and
write answers to the files in /root/lab-answers/.
Tasks
- Take sshd. Find its program, configuration, logs, runtime files and man
pages, and say why each lives where it does. Write one path (or
command) per line to
/root/lab-answers/1: the program, the main configuration file, where its log messages go, a runtime file under/run, and its man page. - Create a file,
locateit, runupdatedbas root, andlocateit again. Delete it and comparelocatewithlocate -e. Write which of the two still lists the deleted file to/root/lab-answers/2. - Add
/srv/archivetoPRUNEPATHSin/etc/updatedb.conf, runupdatedb, and show that its files are no longer found. - Compare
which -a,type -aandwhereisforls,passwdandcd. Write whattype -a cdprints to/root/lab-answers/4. - Time
locate passwdagainstfind / -name passwd 2>/dev/nullwithtime. Check it yourself:locateanswers in milliseconds.
Hints
command -v sshd,systemctl cat sshd(sshon Ubuntu),ls /etc/ssh,journalctl -u,ls /run,man -w sshd.locatesearches a database that onlyupdatedbrefreshes;-echecks that each file still exists.PRUNEPATHSis a space-separated list in double quotes.typeknows about builtins and aliases;whichandwhereisonly about files.