A junior administrator updated the PostgreSQL service unit file per the data-base administrator's recommendation. The service has been restarted, but changes have not been applied. Which of the following should the administrator run for the changes to take effect?
Correct Answer: B
To apply changes to a systemd service unit file, the administrator needs to reload the systemd daemon using the command systemct1 daemon-reload (B). This will make systemd aware of the new or changed unit files. The other commands will not reload the systemd daemon or apply the changes. References: * [CompTIA Linux+ Study Guide], Chapter 7: Managing System Services, Section: Modifying Systemd Services * [How to Reload Systemd Services]
XK0-005 Exam Question 97
A Linux administrator is creating a new sudo profile for the accounting user. Which of the following should be added by the administrator to the sudo configuration file so that the accounting user can run / opt/ acc/ report as root?
Correct Answer: C
This answer allows the accounting user to run the /opt/acc/report command as root on any host without entering a password. The % sign indicates that accounting is a group name, not a user name. The ALL keyword means any host, any user, and any command, depending on the context. The NOPASSWD tag overrides the default behavior of sudo, which is to ask for the user's password. The other answers are incorrect for the following reasons: A) accounting localhost=/opt/acc/report This answer only allows the accounting user to run the command on the localhost, not on any host. This answer also requires the accounting user to enter their password, which is not specified in the question. B) accounting ALL=/opt/acc/report This answer only allows the accounting user to run the command as themselves, not as root. This answer also requires the accounting user to enter their password, which is not specified in the question. D) accounting /opt/acc/report= (ALL) NOPASSWD: ALL This answer has an invalid syntax, as there should be no space between the equal sign and the parentheses. This answer also grants too much privilege to the accounting user, as it allows them to run any command as any user without a password.
XK0-005 Exam Question 98
A Linux system fails to start and delivers the following error message: Which of the following commands can be used to address this issue?
Correct Answer: A
The command fsck.ext4 /dev/sda1 can be used to address the issue. The issue is caused by a corrupted filesystem on the /dev/sda1 partition. The error message shows that the filesystem type is ext4 and the superblock is invalid. The command fsck.ext4 is a tool for checking and repairing ext4 filesystems. The command will scan the partition for errors and attempt to fix them. This command can resolve the issue and allow the system to start. The other options are incorrect because they either do not fix the filesystem (partprobe or fdisk) or destroy the data on the partition (mkfs.ext4). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, page 325.
XK0-005 Exam Question 99
A Linux administrator is configuring network traffic forwarding. Despite having proper iptables rules, the traffic forwarding is not working. Which of the following commands will allow Linux to pass network traffic between different interfaces?
Correct Answer: B
To enable IP forwarding, the kernel parameter net.ipv4.ip_forward must be set to 1. This is done by appending net.ipv4.ip_forward=1 to /etc/sysctl.conf and applying the changes using sysctl -p. This command ensures that the system can forward packets between different network interfaces.
XK0-005 Exam Question 100
Users report that connections to a MariaDB service are being closed unexpectedly. A systems administrator troubleshoots the issue and finds the following message in /var/log/messages: Which of the following is causing the connection issue?
Correct Answer: B
The message in /var/log/messages indicates that the server is running out of file descriptors. A file descriptor is a non-negative integer identifier for an open file in Linux. Each process has a table of open file descriptors where a new entry is appended upon opening a new file. There is a limit on how many file descriptors a process can open at a time, which depends on the system configuration and the user privileges. If a process tries to open more files than the limit, it will fail with an error message like "Too many open files". This could cause connections to be closed unexpectedly or other problems with the application. The other options are not correct causes for the connection issue. The process mysqld is not using too many semaphores, which are synchronization mechanisms for processes that share resources. Semaphores are not related to file descriptors or open files. Something is not starving the server resources, which could mean high CPU usage, memory pressure, disk I/O, network congestion, or other factors that affect performance. These could cause slowdowns or timeouts, but not file descriptor exhaustion. The amount of RAM allocated to the server is not too high, which could cause swapping or paging if it exceeds the physical memory available. This could also affect performance, but not file descriptor availability. References: File Descriptor Requirements (Linux Systems); Limits on the Number of Linux File Descriptors