A user reports that a cron job is not executing. The cron job is defined in /etc/crontab. The administrator checks the system logs and finds no errors. Which command should the administrator use to verify that the cron daemon is running?
Trap 1: systemctl status cron
Incorrect. `systemctl status cron` works only on systems using systemd; also the cron daemon may be named 'crond', not 'cron', leading to a false negative.
Trap 2: crontab -l
crontab -l lists the invoking user's scheduled entries; it never reports daemon state. The stem requires confirming the cron service is active, which systemctl status cron (or equivalent) provides. crontab -l is the right tool for auditing what jobs a user has defined, not for diagnosing whether the scheduler is running.
Trap 3: ps aux | grep cron
Incorrect. `ps aux | grep cron` can show the cron process, but the grep command itself may match its own line, requiring additional filtering (e.g., `grep -v grep`), making it less reliable than `pgrep`.
- A
pgrep cron
pgrep cron scans the process table for a running process named cron, returning its PID if the daemon is active. This directly satisfies the stem's requirement to verify the cron daemon is running, since an empty result confirms it is not, without relying on log entries that showed no errors.
- B
systemctl status cron
Why it fails: Incorrect. `systemctl status cron` works only on systems using systemd; also the cron daemon may be named 'crond', not 'cron', leading to a false negative.
- C
crontab -l
Why it fails: crontab -l lists the invoking user's scheduled entries; it never reports daemon state. The stem requires confirming the cron service is active, which systemctl status cron (or equivalent) provides. crontab -l is the right tool for auditing what jobs a user has defined, not for diagnosing whether the scheduler is running.
- D
ps aux | grep cron
Why it fails: Incorrect. `ps aux | grep cron` can show the cron process, but the grep command itself may match its own line, requiring additional filtering (e.g., `grep -v grep`), making it less reliable than `pgrep`.