LFCS Certification Kernel Parameter Modification 4 — Questions and Answers
Question 1: An admin creates /etc/sysctl.d/99-custom.conf with 'vm.overcommit_memory=2'. When will this setting take effect without a reboot?
- After running 'sysctl --system' (Correct answer)
- Immediately upon saving the file
- After running 'systemctl daemon-reload'
- After running 'sysctl -p'
Correct answer: After running 'sysctl --system'
'sysctl --system' reloads all sysctl configuration files from all standard directories including /etc/sysctl.d/.
Question 2: What does setting 'kernel.panic=30' accomplish?
- Automatically reboots the system 30 seconds after a kernel panic (Correct answer)
- Disables kernel panic after 30 errors
- Waits 30 minutes before logging a kernel panic
- Sets the kernel panic log level to 30
Correct answer: Automatically reboots the system 30 seconds after a kernel panic
kernel.panic=30 causes the kernel to automatically reboot 30 seconds after a kernel panic occurs.
Question 3: Which of the following sysctl parameters is used to control the virtual memory overcommit behavior?
- vm.overcommit_memory (Correct answer)
- vm.swappiness
- vm.dirty_ratio
- vm.min_free_kbytes
Correct answer: vm.overcommit_memory
vm.overcommit_memory controls whether the kernel allows memory allocations that exceed physical + swap memory.
Question 4: A sysctl parameter written via 'echo 1 > /proc/sys/net/ipv4/ip_forward' is equivalent to which sysctl command?
- sysctl -w net.ipv4.ip_forward=1 (Correct answer)
- sysctl net.ipv4.ip_forward=1
- sysctl --set net.ipv4.ip_forward 1
- sysctl -p net.ipv4.ip_forward=1
Correct answer: sysctl -w net.ipv4.ip_forward=1
Writing directly to a /proc/sys file and using 'sysctl -w key=value' both modify the live kernel parameter identically.
Question 5: Which sysctl parameter controls how aggressively the kernel swaps anonymous memory pages to disk?
- vm.swappiness (Correct answer)
- vm.swap_ratio
- vm.overcommit_memory
- kernel.swap_factor
Correct answer: vm.swappiness
vm.swappiness (0-200) determines how aggressively the kernel reclaims anonymous memory by swapping; lower values reduce swapping.
Question 6: What is the correct syntax to apply only the settings in /etc/sysctl.d/99-network.conf without affecting other parameters?
- sysctl -p /etc/sysctl.d/99-network.conf (Correct answer)
- sysctl --load /etc/sysctl.d/99-network.conf
- sysctl --apply /etc/sysctl.d/99-network.conf
- sysctl -f /etc/sysctl.d/99-network.conf
Correct answer: sysctl -p /etc/sysctl.d/99-network.conf
'sysctl -p <file>' reads and applies only the settings from the specified configuration file.
Question 7: Which command verifies that 'net.ipv4.conf.all.accept_redirects' is currently set to 0 on a running system?
- sysctl net.ipv4.conf.all.accept_redirects (Correct answer)
- grep accept_redirects /etc/sysctl.conf
- ip route show | grep redirect
- netstat -s | grep redirect
Correct answer: sysctl net.ipv4.conf.all.accept_redirects
sysctl reads the live kernel value directly from /proc/sys, confirming the actual active setting regardless of config files.
An admin creates /etc/sysctl.d/99-custom.conf with 'vm.overcommit_memory=2'.
When will this setting take effect without a reboot?