LPI 102-500 Practice Test 23
Question 220
A helpdesk escalation describes this Linux behavior: An operator copies an entry from `/etc/crontab` to `crontab -e` and expects its sixth user field to remain valid. Which TWO complementary steps provide the best corrective action and its most direct diagnostic verification? Select TWO answers.
- Inspect `crontab -l` and the corresponding system file and test the schedule with a harmless logged command.
- Assume the sixth username column is mandatory in both per-user crontabs and system-wide cron definitions.
- Use `getent` and supported user or group administration tools to inspect the effective NSS account database without assuming all identities exist in local files.
- Use five time fields followed by a command in a user crontab, and include the user field only in the appropriate system crontab or /etc/cron.d format.
- Inspect the at queue and service status, verify the planned timestamp and run a safe one-time test.
Explanation
Correct Answers
A:Most direct verification evidence: Inspect `crontab -l` and the corresponding system file and test the schedule with a harmless logged command. Linux principle: Per-user cron entries inherit the owner identity and do not contain a username field; system crontab entries add a separate user column.
D:Recommended administrative action: Use five time fields followed by a command in a user crontab, and include the user field only in the appropriate system crontab or /etc/cron.d format. Linux principle: Per-user cron entries inherit the owner identity and do not contain a username field; system crontab entries add a separate user column.
Incorrect Answers
B:This shortcut is unsafe for the present Linux issue: Assume the sixth username column is mandatory in both per-user crontabs and system-wide cron definitions. Per-user cron entries inherit the owner identity and do not contain a username field; system crontab entries add a separate user column.
C:That option would use `getent` and supported user or group administration tools to inspect the effective NSS account database without assuming all identities exist in local files, but it addresses a different concern. Per-user cron entries inherit the owner identity and do not contain a username field; system crontab entries add a separate user column.
E:That option would inspect the at queue and service status, verify the planned timestamp and run a safe one-time test, but it addresses a different concern. Per-user cron entries inherit the owner identity and do not contain a username field; system crontab entries add a separate user column.
Question 221
An operations handoff identifies this problem: A maintenance script runs by hand but fails in cron because the interactive PATH contains a directory absent from the cron job. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Create the intended user with a suitable home directory, shell and UID policy using useradd with the needed options, and verify ownership and skeleton-file deployment.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access.
- Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files.
Explanation
Correct Answer
D:Recommended administrative action: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files.
Incorrect Answers
A:That option would create the intended user with a suitable home directory, shell and UID policy using useradd with the needed options, and verify ownership and skeleton-file deployment, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
B:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. It cannot establish a safe correction.
C:That option would use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Question 222
A team maintaining a Linux host reports: A maintenance script runs by hand but fails in cron because the interactive PATH contains a directory absent from the cron job. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- cron and at can enforce distinct user-access controls, and the presence of an allow file often changes who may submit jobs.
- The timezone controls presentation of timestamps independently of UTC-based timekeeping; a TZ environment value normally affects only processes that use it.
- Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Explanation
Correct Answer
D:Relevant Linux operating principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
B:This alternative addresses Cron and at user-access allow deny policies, not the specific issue of Cron execution environment and absolute paths: cron and at can enforce distinct user-access controls, and the presence of an allow file often changes who may submit jobs. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
C:This alternative addresses Timezone files, TZ override and timedatectl, not the specific issue of Cron execution environment and absolute paths: The timezone controls presentation of timestamps independently of UTC-based timekeeping; a TZ environment value normally affects only processes that use it. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
Question 223
While verifying a Linux change request, an engineer finds: A maintenance script runs by hand but fails in cron because the interactive PATH contains a directory absent from the cron job. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Inspect account UID and shell, service unit User setting, writable paths, group membership and whether interactive authentication is possible.
- Compare `id` and getent group output before and after changes and test a fresh login for access to both old and new groups.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment.
Explanation
Correct Answer
D:Most direct verification evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment.
Incorrect Answers
A:That option would inspect account UID and shell, service unit User setting, writable paths, group membership and whether interactive authentication is possible, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
B:That option would compare `id` and getent group output before and after changes and test a fresh login for access to both old and new groups, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
C:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. It cannot establish a safe correction. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Question 224
A Linux administrator investigates the following system incident: A maintenance script runs by hand but fails in cron because the interactive PATH contains a directory absent from the cron job. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
- The deactivated account cannot start unauthorized sessions, and retained data is handled according to approved policy.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
Explanation
Correct Answer
A:Observable acceptance criterion: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
Incorrect Answers
B:This alternative addresses Account locking suspension and safe removal, not the specific issue of Cron execution environment and absolute paths: The deactivated account cannot start unauthorized sessions, and retained data is handled according to approved policy. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
C:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. It cannot establish a safe correction. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
D:This alternative addresses Shadow password entries and password aging, not the specific issue of Cron execution environment and absolute paths: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
Question 225
On a production Linux workstation or server, a technician observes: A maintenance script runs by hand but fails in cron because the interactive PATH contains a directory absent from the cron job. Which misleading assumption MOST directly contributes to this failure and should be rejected? Select ONE best answer.
- Assume any enabled .service automatically schedules itself and that every timer catches up on missed executions without Persistent.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- Use `usermod -G newgroup` without `-a` and assume it appends the group while retaining all previous memberships.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
Explanation
Correct Answer
B:Reject this specific misconception: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. It incorrectly assumes behavior that conflicts with the observed Linux conditions.
Incorrect Answers
A:That option would assume any enabled .service automatically schedules itself and that every timer catches up on missed executions without Persistent, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
C:That option would use `usermod -G newgroup` without `-a` and assume it appends the group while retaining all previous memberships, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
D:This alternative addresses Shadow password entries and password aging, not the specific issue of Cron execution environment and absolute paths: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
Question 226
During an LPIC-1 practice lab, the operator encounters this condition: A nightly job relies on an interactive Bash alias and a GUI environment variable, so scheduled execution cannot find its command. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access.
- Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files.
- Use a distinct appropriately limited service or system account, choose a non-login shell and limit filesystem and group rights to the daemon's needs.
Explanation
Correct Answer
C:Recommended administrative action: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
B:This alternative addresses Shadow password entries and password aging, not the specific issue of Cron execution environment and absolute paths: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access.
D:That option would use a distinct appropriately limited service or system account, choose a non-login shell and limit filesystem and group rights to the daemon's needs, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Question 227
A helpdesk escalation describes this Linux behavior: A nightly job relies on an interactive Bash alias and a GUI environment variable, so scheduled execution cannot find its command. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- Nonhuman service identities reduce the blast radius of background processes; human interactive login and unrestricted privilege are not prerequisites for a daemon.
- The at daemon queues single-run jobs for specified times, while cron describes recurring schedules, and each queue entry has a removable job ID.
- Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
Explanation
Correct Answer
C:Relevant Linux operating principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Incorrect Answers
A:This alternative addresses System service accounts and least privilege, not the specific issue of Cron execution environment and absolute paths: Nonhuman service identities reduce the blast radius of background processes; human interactive login and unrestricted privilege are not prerequisites for a daemon. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
B:This alternative addresses One-time at jobs and queue management, not the specific issue of Cron execution environment and absolute paths: The at daemon queues single-run jobs for specified times, while cron describes recurring schedules, and each queue entry has a removable job ID. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
D:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. It cannot establish a safe correction. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Question 228
An operations handoff identifies this problem: A nightly job relies on an interactive Bash alias and a GUI environment variable, so scheduled execution cannot find its command. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Review passwd status, chage or usermod lock fields, SSH key access, active sessions and retention or account-removal records.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment.
- Inspect account UID and shell, service unit User setting, writable paths, group membership and whether interactive authentication is possible.
Explanation
Correct Answer
C:Most direct verification evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Incorrect Answers
A:That option would review passwd status, chage or usermod lock fields, SSH key access, active sessions and retention or account-removal records, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
B:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. It cannot establish a safe correction. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
D:This alternative addresses System service accounts and least privilege, not the specific issue of Cron execution environment and absolute paths: Inspect account UID and shell, service unit User setting, writable paths, group membership and whether interactive authentication is possible.
Question 229
A team maintaining a Linux host reports: A nightly job relies on an interactive Bash alias and a GUI environment variable, so scheduled execution cannot find its command. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
- Only authorized identities can add or change the intended recurring or one-time jobs under the documented policy.
Explanation
Correct Answer
C:Observable acceptance criterion: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Incorrect Answers
A:This alternative addresses Shadow password entries and password aging, not the specific issue of Cron execution environment and absolute paths: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
B:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
D:This alternative addresses Cron and at user-access allow deny policies, not the specific issue of Cron execution environment and absolute paths: Only authorized identities can add or change the intended recurring or one-time jobs under the documented policy. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured. Appropriate response: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Root-cause evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Independent acceptance: A controlled scheduled invocation completes with expected credentials and executables independent of interactive shell customizations.
Question 230
While verifying a Linux change request, an engineer finds: A nightly job relies on an interactive Bash alias and a GUI environment variable, so scheduled execution cannot find its command. Which TWO complementary steps provide the best corrective action and its most direct diagnostic verification? Select TWO answers.
- Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files.
- Configure the system timezone with `timedatectl set-timezone` or supported zoneinfo linkage and use TZ for deliberate per-process overrides.
- Inspect getent passwd for the account, stat the home directory and review useradd defaults, ownership and login shell.
- Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
Explanation
Correct Answers
A:Recommended administrative action: Provide explicit executable paths and required environment variables in the crontab or wrapper, avoiding assumptions about interactive startup files. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
D:Most direct verification evidence: Log the job's environment and standard error, inspect effective PATH and the scheduler's recorded command, and run in a clean environment. Linux principle: Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
Incorrect Answers
B:That option would configure the system timezone with `timedatectl set-timezone` or supported zoneinfo linkage and use TZ for deliberate per-process overrides, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
C:That option would inspect getent passwd for the account, stat the home directory and review useradd defaults, ownership and login shell, but it addresses a different concern. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.
E:This shortcut is unsafe for the present Linux issue: Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables. Cron typically supplies a minimal noninteractive execution environment; user profile aliases and shell search paths are not assured.