LICM study materials
LICM study resources

Finding an Unknown Configuration File Under Time Pressure

LICM · Put your knowledge to work in context.

All case studies

Finding an Unknown Configuration File Under Time Pressure

It is your first week as a junior Linux administrator at a small ISP. The senior admin is on leave and left you a Debian 12 server running an internal monitoring stack. A developer reports that the 'smokeping' service is using the wrong probe interval and asks you to change it. You know the setting is in a configuration file, but you do not know the path. You have sudo, no internet access, and a strict change window of 20 minutes. You tried find / -name '*smokeping*' and after two minutes it was still printing permission errors from /proc and /sys, so you stopped it. The developer also wants to know where the program's documentation and example configs live. You need to locate the configuration efficiently, make the change, and be able to explain your method to the senior admin.

1. Describe a reliable sequence to find the smokeping configuration file and documentation on this Debian system without scanning the entire filesystem. Include at least three different sources of information and the exact commands.

Read the worked answer

Use package metadata first; it is faster and more accurate than a broad find. On Debian, dpkg -L smokeping lists every file the package installed, so filter for config: dpkg -L smokeping | grep -E '^/etc|conf'. To go the other way from a suspected filename, dpkg -S /etc/smokeping/config shows which package owns it. Second, ask systemd: systemctl cat smokeping.service prints the unit and usually reveals ExecStart= with a -c or --config path; systemctl status gives the running command line. Third, inspect the running process with ps -ef | grep smokeping to see the actual config argument. Fourth, use documentation: man smokeping, man -k smokeping (or apropos smokeping) to find related pages, and ls /usr/share/doc/smokeping/ for examples, README, and changelog. If locate is installed and its database is current, locate smokeping | grep /etc is fast. Only then use a scoped find: find /etc /usr/share/doc -iname '*smokeping*' 2>/dev/null. Avoid find / because /proc and /sys produce errors and slow scans, and mounted network filesystems may hang. After editing, validate with the service's own test, then systemctl reload smokeping and check journalctl -u smokeping -n 50.

2. The developer asks for section 5 of the manual for the configuration file syntax. Explain what man sections are, how to open that section, and what to do if the page is not installed.

Read the worked answer

Man pages are divided into numbered sections. Section 1 is user commands, section 5 is file formats and configuration syntax, and section 8 is system administration commands. The same name can appear in more than one section. man 5 smokeping.conf asks for the file-format page specifically; without the number, man picks the first match, often the command page. If you do not know the exact page name, man -k smokeping searches the whatis database for names and short descriptions, and whatis smokeping.conf shows the one-line summary. If the page is missing, the documentation package may not be installed; on Debian check dpkg -L smokeping | grep man and install the package or its docs if appropriate. Also look in /usr/share/doc/smokeping/, which often contains HTML or README files. If you see a page but the config syntax is unclear, man 5 for the specific file and the examples under /usr/share/doc together are more reliable than guessing. Remember man man explains the section layout, and man -a name shows every section's page in sequence. In a change window, confirm the page's version matches the installed package rather than relying on a web copy.

3. Where should the edited configuration and the service's logs live according to the Filesystem Hierarchy Standard, and why should you not edit files under /usr?

Read the worked answer

Under the Filesystem Hierarchy Standard, /etc is for host-specific configuration; the smokeping config belongs in /etc/smokeping/, never in /usr. /usr is shareable, read-only data: binaries, libraries, and documentation. Editing /usr/bin/smokeping or a file under /usr/share is wrong because package upgrades overwrite it and because /usr may be mounted read-only or shared between hosts. /var/log holds variable log data, /var/lib holds persistent state such as databases, /srv holds data served to users, and /opt is for add-on software trees. If the setting is a local override, prefer a file in /etc included by the main config rather than editing a packaged default. Back up the original with cp -a file file.bak in the same directory, keep a note of the change, and use systemctl reload rather than restart if the daemon supports it. This preserves the package's files and makes rollback and audits straightforward.