3 Basic Commands and Simple Shell Scripts Once you have your first Red Hat Enterprise Linux rhel



Download 1.85 Mb.
View original pdf
Page34/67
Date26.02.2024
Size1.85 Mb.
#63678
1   ...   30   31   32   33   34   35   36   37   ...   67
Pablo Iranzo Gómez, Pedro Ibáñez Requena, Miguel Pérez Colino, Scott McCarty - Red Hat Enterprise Linux 9 Administration-Packt Publishing (2022) -chap 3 82 - 180
4
Tools for Regular Operations
At this point in this book, we’ve installed a system, and we’ve covered some of the scripts we can create to automate tasks, so we’ve reached the point where we can focus on the system itself.
Having a system properly configured requires not only installing it but understanding how to run tasks at specific times, keeping all the services running appropriately, and configuring time synchronization, service management, boot targets (runlevels), and scheduled tasks, all of which we will be covering in this chapter. We’ll be additionally starting to mention Cockpit (web console, which will be covered during the whole book as a tool to perform administration tasks from a web interface.
In this chapter, you will learn how to check the statuses of services and how to start, stop, and troubleshoot them, as well as how to keep the system clock in sync for your server or your whole network.
The list of topics that will be covered is presented here Managing system services with systemd
• Scheduling tasks with cron and systemd
• Learning about time synchronization with chrony and the Network Time Protocol (NTP)
• Checking for free resources—memory and disk (free and df)
Finding logs, using journald, and reading log files, including log preservation and rotation
Technical requirements
It is possible for you to complete this chapter by using the virtual machine (VM) we created at the beginning of this book. Additionally, for testing the NTP server, it might be useful to create a second
VM that will connect to the first one as a client, following the same procedure we used for the first one. Additionally, required packages will be indicated within the text.

Tools for Regular Operations
104
Managing system services with systemd
In this section, you will learn how to manage system services, runtime targets, and all about the service status with systemd. You will also learn how to manage system boot targets and services that should start at system boot.
systemd (which you can learn a bit about at https://www.freedesktop.org/wiki/
Software/systemd/) is defined as ab system daemon
that’s used to manage the system. It came as a rework of how a system boots and starts, and it looks at the limitations related to the traditional way of doing it.
When we think about the system starting, we have the initial kernel and ramdisk load and execution, but right after that, services and scripts take control to make filesystems available. This helps prepare the services that provide the functionality we want from our system, such as the following Hardware detection Additional filesystem activation Network initialization (wired, wireless, and soon Network services (time sync, remote login, printers, network filesystems, and soon User-space setup
However, most of the tools that existed before systemd came into play worked on this in a sequential way, causing the whole boot process (from boot to user login) to become lengthy and be subject to delays.
Traditionally, this also meant we had to wait for the required service to be fully available before the next one that depended on it could be started, increasing the total boot time.
Some approaches were attempted, such as using Monit or other tools that allow us to define dependencies, monitor processes, and even recover from failures, but in general, it was reusing an existing tool to perform other functions, trying to win the race regarding the fastest-booting system.

Download 1.85 Mb.

Share with your friends:
1   ...   30   31   32   33   34   35   36   37   ...   67




The database is protected by copyright ©ininet.org 2024
send message

    Main page