108 Essential System Services KT Flashcards
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.
108.3 Mail Transfer Agent (MTA) basics
Terms and Utilities:
~/.forward sendmail emulation layer commands newaliases mail mailq postfix sendmail exim
~/.forward
Email forwarding file. If this file exists, smtpd(8) forwards email to the destinations specified therein.
sendmail emulation layer commands
These are backwards compatible commands that can be used with MTAs other than sendmail.
newaliases
Command: The newaliases utility makes changes to the mail aliases file visible to smtpd(8).
newaliases [-f file]
Command: mail is an intelligent mail processing system which has a command syntax reminiscent of ed(1) with lines replaced by messages.
mail -words [-dEIinv ]
[-a header ] [-b bcc-addr ]
[-c cc-addr ] [-s subject ]
to-addr …
mailq
Command: List the mail queue. Each entry shows the queue file ID, message size, arrival time, sender, and the recipients that still need to be delivered.
mailq
postfix
Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail.
sendmail
Sendmail is a general purpose internetwork email routing facility that supports many kinds of mail-transfer and delivery methods.
exim
Exim is a mail transfer agent (MTA) used on Unix-like operating systems.
108.4 Manage printers and printing
The following is a partial list of the used files, terms and utilities:
CUPS configuration files, tools and utilities
/etc/cups/
lpd legacy interface (lpr, lprm, lpq)
CUPS configuration files
The cups-files.conf file configures the files and directories used by the CUPS scheduler, cupsd(8). It is normally located in the /etc/cups directory.
CUPS tools
The cupsctl(8) program is used to manage the printing system as a whole, including things like debug logging and printer sharing.
CUPS utilities
The lpadmin(8) program is used to add, modify, or delete destinations, while the lpinfo(8) command is used to list the available printer drivers and backends.
/etc/cups/
The /etc/cups/ directory holds all of the cups configuration files.
lpd legacy interface
cups-lpd is the CUPS Line Printer Daemon (“LPD”) mini-server that supports legacy client systems that use the LPD protocol.
lpr
Command: lpr submits files for printing.
lpr [ -E ] [ -H server[:port] ] [ -U username ]
[ -P destination[/instance] ] [ -# num-copies [ -h ] [ -l ] [ -m ] [ -o option[=value] ] [ -p ] [ -q ] [ -r ] [ -C title ] [ -J title ]
[ -T title ] [ file(s) ]
lprm
Command: lprm cancels print jobs that have been queued for printing.
lprm [ -E ] [ -U username ] [ -h server[:port] ]
[ -P destination[/instance] ] [ - ] [ job-id(s) ]
lpq
Command: lpq shows the current print queue status on the named printer.
lpq [ -E ] [ -U username ] [ -h server[:port] ]
[ -P destination[/instance] ] [ -a ] [ -l ] [ +interval ]