Oracle 1z0-106 - Oracle Linux 8 Advanced System Administration
Which two statements are true about the configuration and use of cron or anacron?
cron jobs may run only once a minute.
All crontabs are held in the /etc/cron.d directory.
The crond daemon looks for jobs only in /etc/crontab.
anacron jobs may run only once a day.
anacron jobs are used to run cron jobs if the system was powered off when they were scheduled to run.
The Answer Is:
D, EExplanation:
Option D: anacron jobs may run only once a day.
Explanation:
Anacronis designed for systems that are not running continuously (e.g., desktops or laptops that may be powered off at night). It ensures that scheduled tasks are executed at the specified intervals.
Anacron jobs are defined with periods indays. The minimal unit of time for scheduling in Anacron isone day. Therefore, Anacron can schedule jobs to runonce a dayat most.
It is not intended for tasks that need to run multiple times per day.
Oracle Linux Reference:
Oracle® Linux 8: Scheduling Tasks- Section onAnacron Configuration Files:
"Anacron is used to run commands periodically with a frequency specified in days."
Option E: anacron jobs are used to run cron jobs if the system was powered off when they were scheduled to run.
Explanation:
Anacron complements Cron by ensuring thatscheduled jobs are not missedif the system is powered off or in standby mode at the time they were supposed to run.
When the system boots up, Anacron checks for any scheduled jobs that did not run and executes them accordingly.
This is particularly useful for laptops or desktops that are not always on.
Oracle Linux Reference:
Oracle® Linux 8: Scheduling Tasks- Section onUnderstanding Anacron:
"Anacron is designed to run commands periodically with specified frequency, but unlike cron, it does not assume that the system is running continuously."
Why Other Options Are Not Correct:
Option A:cron jobs may run only once a minute.
Explanation:
Cron allows scheduling tasks with a minimum granularity ofone minute. However, this means that tasks can be scheduled to runevery minute, not limited to only once a minute.
Multiple cron jobs can be scheduled to run at the same minute.
Therefore, the statement is misleading; cron jobs can runas frequently as every minute, but notonly once a minute.
Option B:All crontabs are held in the /etc/cron.d directory.
Explanation:
The /etc/cron.d directory is used for system-wide cron jobs provided by packages or administrators.
User-specific cron jobs are stored in /var/spool/cron/ or managed via the crontab command and not placed in /etc/cron.d.
Additionally, the system crontab file is /etc/crontab, and there are also directories like /etc/cron.hourly, /etc/cron.daily, etc.
Option C:The crond daemon looks for jobs only in /etc/crontab.
Explanation:
The crond daemon checks multiple locations for scheduled jobs:
User crontabs managed via the crontab -e command (stored in /var/spool/cron/).
System-wide crontab file (/etc/crontab).
The /etc/cron.d/ directory.
The /etc/cron.hourly/, /etc/cron.daily/, /etc/cron.weekly/, and /etc/cron.monthly/ directories.
Therefore, crond does not look for jobsonlyin /etc/crontab.
Conclusion:
OptionsDandEare correct because they accurately describe the characteristics and purposes of Anacron in the context of scheduling tasks on an Oracle Linux system.
Examine this command:
$ podman run –name=oracleshell -it oraclelinux:8 -slim
Which two statements are true upon execution?
The container creates and starts an interactive shell.
The container named oracleshell must already exist; otherwise, the command fails.
The command fails if the oraclelinux:8 -slim image does not exist on the local machine.
The container is created and started in a single command.
The container is removed by typing exit at the bash shell prompt.
The Answer Is:
A, DExplanation:
Understanding the Command:
$ podman run --name=oracleshell -it oraclelinux:8-slim
(Note: The image is likely oraclelinux:8-slim without a space.)
podman run:Creates and starts a new container.
--name=oracleshell:Assigns the name oracleshell to the container.
-it:Runs the container in interactive mode with a pseudo-TTY.
oraclelinux:8-slim:Specifies the image to use.
Option A: The container creates and starts an interactive shell.
Explanation:
The -it option runs the container interactively.
If no command is specified, it executes the default command in the image (usually /bin/bash).
This provides an interactive shell inside the container.
Oracle Linux Reference:
Oracle® Linux 8: Managing Containers-Running Containers Interactively:
"You can run a container in interactive mode using the -i and -t options together."
Option D: The container is created and started in a single command.
Explanation:
The podman run command handles both creation and starting of the container.
There's no need to create the container separately.
Oracle Linux Reference:
Oracle® Linux 8: Managing Containers-Creating and Running Containers:
"The podman run command creates and starts a container in one operation."
Why Other Options Are Incorrect:
Option B:The container does not need to pre-exist; podman run creates it if it doesn't exist.
Option C:If the image doesn't exist locally, podman will attempt to pull it from the registry.
Oracle Linux Reference:
Oracle® Linux 8: Managing Containers-Pulling Images:
"If you attempt to run a container with an image that does not exist locally, Podman automatically pulls the image from a registry."
Option E:The container is not removed upon exit unless the --rm option is used.
Oracle Linux Reference:
Oracle® Linux 8: Managing Containers-Automatically Removing Containers:
"Use the --rm option to automatically remove the container when it exits."
Conclusion:
Correct Options:A, D
Summary:The command creates and starts a new container named oracleshell and opens an interactive shell session inside it.
Which three statements are true about DNF modules?
Modules are a group of packages that are installed together along with dependencies.
Installing a module allows a user to select a specific stream.
Profiles are used to provide alternate versions of the same module.
Streams are used to define optional configurations of modules.
Streams cannot declare dependencies on the streams of other modules.
Packages exist in multiple streams, where each stream contains a different version.
Switching an enabled module stream automatically changes installed packages.
The Answer Is:
A, B, FExplanation:
Understanding DNF Modules:
DNF modules in Oracle Linux 8 provide a way to offer different versions of software (packages) to users, allowing them to choose the version that best suits their needs. Modules help in managing multiple versions of software by grouping packages, defining streams, and using profiles for configurations.
Option A: Modules are a group of packages that are installed together along with dependencies.
Explanation:
Modulesare collections of packages that are grouped together to represent an application, language runtime, or any logical set.
When you install a module, you are installing a set of packages along with their dependencies.
This grouping ensures that all necessary components are installed for the software to function correctly.
Oracle Linux Reference:
Oracle® Linux 8: Managing Software-About Modules:
"A module is a group of packages that represents a component, such as an application, a language runtime, or a set of tools."
Option B: Installing a module allows a user to select a specific stream.
Explanation:
Streamsin a module represent different versions of the software.
When installing a module, you can select a specific stream to install the desired version.
This allows users to choose between multiple versions of the same software provided within the module.
Oracle Linux Reference:
Oracle® Linux 8: Managing Software-About Module Streams:
"Each module can have one or more streams, which represent versions of the module content."
Example Command:
# dnf module list nodejs
This command lists available streams for the nodejs module.
Option F: Packages exist in multiple streams, where each stream contains a different version.
Explanation:
Within a module, each stream can contain different versions of the packages.
This means the same package can exist in multiple streams but with different versions in each stream.
This setup allows users to install the version of the software that meets their requirements.
Oracle Linux Reference:
Oracle® Linux 8: Managing Software-About Module Streams:
"Different streams can contain different versions of the software, allowing you to select the version that best suits your needs."
Why Other Options Are Incorrect:
Option C: Profiles are used to provide alternate versions of the same module.
Explanation:
Profilesdefine sets of packages within a module stream for specific use cases or configurations, not alternate versions.
Streams provide alternate versions, whereas profiles provide different package sets within a stream.
Oracle Linux Reference:
Oracle® Linux 8: Managing Software-About Module Profiles:
"A profile is a list of packages that defines a particular use case for a module stream."
Option D: Streams are used to define optional configurations of modules.
Explanation:
Streams define different versions of software, not optional configurations.
Optional configurations are managed through profiles within a stream.
Oracle Linux Reference:
Profiles handle configurations, while streams handle versions.
Option E: Streams cannot declare dependencies on the streams of other modules.
Explanation:
Streams can declare dependencies on specific streams of other modules.
This allows modules to work together with compatible versions.
Oracle Linux Reference:
Oracle® Linux 8: Managing Software-Module Dependencies:
"Modules can declare dependencies on specific streams of other modules."
Option G: Switching an enabled module stream automatically changes installed packages.
Explanation:
Switching streams does not automatically change installed packages.
You must reset the module and install the new stream's packages manually.
Oracle Linux Reference:
Oracle® Linux 8: Managing Software-Switching Module Streams:
"To switch to a different module stream, you must reset the module and then install the packages from the new stream."
Conclusion:
Correct Options:A, B, F
Summary:Modules group packages with dependencies, installing a module allows selecting a specific stream (version), and packages can exist in multiple streams with different versions.
Examine this udev device naming rule which gets processed successfully:
makefile
KERNEL=="hdb", DRIVER=="ide-disk", SYMLINK+="sparedisk"
Which two statements are true?
Symbolic link /dev/sparedisk is created linking to /dev/hdb and with an ide-disk device driver, thus overwriting existing symbolic links.
The matching device will be named /dev/sparedisk.
Symbolic link /dev/sparedisk is created for a device named /dev/hdb which has an ide-disk device driver if such a device is discovered.
The matching device will have the kernel device name /dev/hdb.
Symbolic link /dev/sparedisk is created for a device named /dev/hdb or one that has an ide-disk device driver, whichever is discovered first.
The Answer Is:
C, DExplanation:
ï‚·Option C (Correct):If a device named/dev/hdbwith theide-diskdriver is discovered, a symbolic link/dev/sparediskwill be created, pointing to/dev/hdb.
ï‚·Option D (Correct):TheKERNEL=="hdb"match specifies that the device will have the kernel device name/dev/hdb.
ï‚·Option A (Incorrect):This is incorrect because existing symbolic links are not overwritten unless explicitly defined.
ï‚·Option B (Incorrect):The device itself is not renamed to/dev/sparedisk; rather, a symbolic link is created.
ï‚·Option E (Incorrect):The rule specifically requires bothKERNEL=="hdb"andDRIVER=="ide-disk"to match; it is not an either/or condition.
Which are three of the network bonding modes supported in Oracle Linux 8?
Multicast
Round-robin
Split Horizon
802.3ad
Poison Reverse
Active Backup
Passive Backup
The Answer Is:
B, D, FExplanation:
Option B (Correct):Round-robin is a network bonding mode that distributes outgoing traffic evenly across all active network interfaces.
Option D (Correct):802.3ad (LACP - Link Aggregation Control Protocol) is a bonding mode that allows dynamic aggregation of links conforming to the IEEE 802.3ad standard.
Option F (Correct):Active Backup is a bonding mode where one interface is active while the other is in standby, providing redundancy.
Options A, C, E, G (Incorrect):Multicast, Split Horizon, Poison Reverse, and Passive Backup are not valid bonding modes in Oracle Linux 8.
Oracle Linux Reference:Refer to:
Oracle® Linux 8: Network Bonding Guide
Which two methods of changing kernel parameters can you use to modify values for the running system?
Issuing the sysctl -w command to write values to specific files in the /proc/sys directory.
Using the echo command to write values to specific files in the /proc/sys directory.
Issuing the sysctl -w command to write values to specific files in the /sys directory.
Using the echo command to write values to specific files in the /sys directory.
Adding to or modifying parameters and values in the /etc/sysctl.conf file followed by issuing the sysctl -p command.
The Answer Is:
A, BExplanation:
Explanation of Answer A:Thesysctl -wcommand is used to modify kernel parameters at runtime. It allows you to set the value of a specific parameter in the/proc/sysdirectory. For example,sysctl -w net.ipv4.ip_forward=1will enable IP forwarding by writing the value directly to the corresponding file in/proc/sys.
Explanation of Answer B:Using theechocommand to write values directly to specific files in the/proc/sysdirectory is another method to change kernel parameters dynamically for the running system. For instance,echo 1 > /proc/sys/net/ipv4/ip_forwardachieves the same effect as thesysctl -wcommand.
Examine this network configuration:
NAME="ens4"
DEVICE="ens4"
ONBOOT=no
NETBOOT=yes
IPV6INIT=yes
BOOTPROTO=none
IPADDR=192.168.2.5
PREFIX=24
GATEWAY=192.168.2.1
TYPE=Ethernet
Which two statements are true after executing nmcli con mod ens4 ipv4.method auto?
Interface ens4 automatically starts on boot.
BOOTPROTO value is set to dhcp.
ONBOOT value is set to yes.
IPADDR value is considered null.
ONBOOT value is set to dhcp.
Interface ens4 is assigned an IP address of 192.168.2.5.
The Answer Is:
B, DExplanation:
Explanation of Answer B:When executingnmcli con mod ens4 ipv4.method auto, theipv4.methodparameter is set toauto, which configures the interface to obtain its IP address using DHCP. This means that theBOOTPROTOvalue in the configuration is set todhcp.
Explanation of Answer D:Whenipv4.methodis set toauto(DHCP), any static IP address specified inIPADDRis considered null because the interface will now obtain its IP address from a DHCP server, making the manually set IP address irrelevant.
Which mdadm command creates a RAID-1 device consisting of two block volumes and one spare device?
mdadm –create /dev/md0 –level=5 –raid-devices=2 /dev/xvdd1 /dev/xvdd2 –spare-devices=1 /dev/xvdd3
mdadm –create /dev/md0 –level=1 –raid-devices=2 /dev/xvdd1 /dev/xvdd2
mdadm –create /dev/md0 –level=1 –raid-devices=2 /dev/xvdd1 /dev/xvdd2 –spare-devices=1 /dev/xvdd3
mdadm –create /dev/md0 –level=0 –raid-devices=2 /dev/xvdd1 /dev/xvdd2 –spare-devices=1 /dev/xvdd3
The Answer Is:
CExplanation:
The correct command to create a RAID-1 device (mirroring) consisting of two block volumes with one spare device is optionC:mdadm –create /dev/md0 –level=1 –raid-devices=2 /dev/xvdd1 /dev/xvdd2 –spare-devices=1 /dev/xvdd3.
RAID Level 1:RAID-1, also known as mirroring, involves creating an exact copy (or mirror) of a set of data on two or more disks. This ensures data redundancy; if one disk fails, the other can still provide the data.
mdadm Command Structure:Themdadmcommand is used to manage and monitor RAID devices on Linux. To create a new RAID array, the--createoption is used, followed by several parameters:
/dev/md0: The name of the RAID device to be created.
--level=1: Specifies RAID level 1 (mirroring).
--raid-devices=2: Indicates the number of active devices (two in this case) to be used in the RAID array.
/dev/xvdd1 /dev/xvdd2: The two block devices that will form the RAID-1 array.
--spare-devices=1 /dev/xvdd3: Specifies one spare device (/dev/xvdd3). A spare device is used to automatically replace a failed device in the RAID array.
Option Analysis:
A.Incorrect because it specifies RAID level 5 (--level=5), which requires at least three devices and does not match the requirement for RAID-1.
B.Incorrect because it does not include the--spare-devices=1option, meaning there is no spare device included in this configuration.
C.Correct as it specifies RAID-1 (--level=1), two active devices (--raid-devices=2), and one spare device (--spare-devices=1).
D.Incorrect because it specifies RAID level 0 (--level=0), which is a striped set (no redundancy), not a mirrored set (RAID-1).
Oracle Linux Reference:For more detailed information aboutmdadmand RAID configurations in Oracle Linux 8, refer to the following Oracle Linux documentation:
Oracle® Linux 8 Managing Storage Devices - RAID Configuration
Oracle® Linux 8 mdadm Manual
These references provide comprehensive details on RAID levels,mdadmcommand syntax, and options for creating and managing RAID arrays in Oracle Linux.