108 Essential System Services KT Flashcards
(42 cards)
108.1 Maintain system time
The following is a partial list of the used files, terms and utilities:
/usr/share/zoneinfo/ /etc/timezone /etc/localtime /etc/ntp.conf /etc/chrony.conf date hwclock timedatectl ntpd ntpdate chronyc pool.ntp.org
/usr/share/zoneinfo/
The system timezone database directory.
/etc/timezone
The /etc/timezone file is a plain text file. It usually includes the continent and place, unless a more generic setting is used like UTC.
/etc/localtime
The system timezone file.
/etc/ntp.conf
The /etc/ntp.conf file is the primary configuration file for the ntpd service.
/etc/chrony.conf
This is the location where the chrony.conf file is compiled. chrony.conf is the configuration file for the chronyd daemon.
date
Command: Displays the system clock.
hwclock
Command: hwclock is an administration tool for the time clocks.
hwclock [function] [option…]
timedatectl
Command: Displays the system clock, UTC, and timezone information.
ntpd
The Network Time Protocol daemon (ntpd) is a process that ensures the system clock is in sync with the time provided by remote NTP servers.
ntpdate
Command: ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s). Servers are given as arguments to determine the correct time. It must be run as root on the local host.
ntpdate [ -46bBdqsuv ] [ -a key ] [ -e authdelay] [ -k keyfile ] [ -o version ] [ -p samples ] [ -t timeout ] [ -U user_name] server [ ... ]
chronyc
Command: chronyc is a command-line interface program which can be used to monitor chronyd’s performance and to change various operating parateters whilst it is running.
chrony is a pair of programs for maintaining the accuracy of computer clocks.
chronyc [OPTIONS]
pool.ntp.org
The pool.ntp.org address is a link to a cluster of NTP servers that are geographically spread throughout the world.
108.2 System logging
Terms and Utilities:
/etc/rsyslog.conf /var/log/ logger logrotate /etc/logrotate.conf /etc/logrotate.d/ journalctl systemd-cat /etc/systemd/journald.conf /var/log/journal/
/etc/rsyslog.conf
The rsyslog.conf file is the main configuration file for the rsyslogd(8) which logs system messages on *nix systems.
/var/log/
The /var/log/ directory is the standard location for log files to be placed by the syslogd daemon.
logger
Command: logger makes entries in the system log.
logger [options] [message]
logrotate
Command: logrotate is designed to ease administration of systems that generate large numbers of log files.
logrotate [–debug] [–verbose] [–log file] [–force] [–state file] [–mail command] config_file [config_file2 …]
/etc/logrotate.conf
The /etc/logrotate.conf is the primary configuration file for the logrotate command.
/etc/logrotate.d/
The /etc/logrotate.d/ directory stores application specific log settings.
journalctl
Command: journalctl may be used to query the contents of the systemd(1) journal as written by systemd-journald.service(8).
journalctl [OPTIONS…] [MATCHES…]
systemd-cat
Command: systemd-cat may be used to connect the standard input and output of a process to the journal.
systemd-cat [OPTIONS…] [COMMAND] [ARGUMENTS…]
/etc/systemd/journald.conf
These files configure various parameters of the systemd journal service, systemd-journald.service(8).
/var/log/journal/
The /var/log/journal/ directory is where systemd stores logs.