committing changes in /etc made by "-bash"

Package changes:
This commit is contained in:
2021-08-28 09:35:07 +03:00
parent 24cd722853
commit 5e261df3ef
5 changed files with 367 additions and 0 deletions

View File

@@ -86,6 +86,7 @@ mkdir -p './security/console.perms.d'
mkdir -p './security/namespace.d'
mkdir -p './security/pwquality.conf.d'
mkdir -p './selinux/targeted/logins'
mkdir -p './smartmontools/smartd_warning.d'
mkdir -p './sssd/conf.d'
mkdir -p './sssd/pki'
mkdir -p './subversion'
@@ -4706,6 +4707,10 @@ maybe chmod 0755 'skel'
maybe chmod 0644 'skel/.bash_logout'
maybe chmod 0644 'skel/.bash_profile'
maybe chmod 0644 'skel/.bashrc'
maybe chmod 0755 'smartmontools'
maybe chmod 0644 'smartmontools/smartd.conf'
maybe chmod 0755 'smartmontools/smartd_warning.d'
maybe chmod 0755 'smartmontools/smartd_warning.sh'
maybe chmod 0755 'snmp'
maybe chmod 0755 'snmp/bind'
maybe chmod 0644 'snmp/bind.config'
@@ -4872,6 +4877,7 @@ maybe chmod 0644 'sysconfig/rsyslog'
maybe chmod 0644 'sysconfig/run-parts'
maybe chmod 0644 'sysconfig/sa-update'
maybe chmod 0644 'sysconfig/saslauthd'
maybe chmod 0644 'sysconfig/smartmontools'
maybe chmod 0644 'sysconfig/snapd'
maybe chmod 0644 'sysconfig/snmpd'
maybe chmod 0644 'sysconfig/snmptrapd'

145
smartmontools/smartd.conf Normal file
View File

@@ -0,0 +1,145 @@
# Sample configuration file for smartd. See man smartd.conf.
# Home page is: http://www.smartmontools.org
# $Id: smartd.conf 4120 2015-08-27 16:12:21Z samm2 $
# smartd will re-read the configuration file if it receives a HUP
# signal
# The file gives a list of devices to monitor using smartd, with one
# device per line. Text after a hash (#) is ignored, and you may use
# spaces and tabs for white space. You may use '\' to continue lines.
# You can usually identify which hard disks are on your system by
# looking in /proc/ide and in /proc/scsi.
# The word DEVICESCAN will cause any remaining lines in this
# configuration file to be ignored: it tells smartd to scan for all
# ATA and SCSI devices. DEVICESCAN may be followed by any of the
# Directives listed below, which will be applied to all devices that
# are found. Most users should comment out DEVICESCAN and explicitly
# list the devices that they wish to monitor.
DEVICESCAN -H -m root -M exec /usr/libexec/smartmontools/smartdnotify -n standby,10,q
# Alternative setting to ignore temperature and power-on hours reports
# in syslog.
#DEVICESCAN -I 194 -I 231 -I 9
# Alternative setting to report more useful raw temperature in syslog.
#DEVICESCAN -R 194 -R 231 -I 9
# Alternative setting to report raw temperature changes >= 5 Celsius
# and min/max temperatures.
#DEVICESCAN -I 194 -I 231 -I 9 -W 5
# First ATA/SATA or SCSI/SAS disk. Monitor all attributes, enable
# automatic online data collection, automatic Attribute autosave, and
# start a short self-test every day between 2-3am, and a long self test
# Saturdays between 3-4am.
#/dev/sda -a -o on -S on -s (S/../.././02|L/../../6/03)
# Monitor SMART status, ATA Error Log, Self-test log, and track
# changes in all attributes except for attribute 194
#/dev/sdb -H -l error -l selftest -t -I 194
# Monitor all attributes except normalized Temperature (usually 194),
# but track Temperature changes >= 4 Celsius, report Temperatures
# >= 45 Celsius and changes in Raw value of Reallocated_Sector_Ct (5).
# Send mail on SMART failures or when Temperature is >= 55 Celsius.
#/dev/sdc -a -I 194 -W 4,45,55 -R 5 -m admin@example.com
# An ATA disk may appear as a SCSI device to the OS. If a SCSI to
# ATA Translation (SAT) layer is between the OS and the device then
# this can be flagged with the '-d sat' option. This situation may
# become common with SATA disks in SAS and FC environments.
# /dev/sda -a -d sat
# A very silent check. Only report SMART health status if it fails
# But send an email in this case
#/dev/sdc -H -C 0 -U 0 -m admin@example.com
# First two SCSI disks. This will monitor everything that smartd can
# monitor. Start extended self-tests Wednesdays between 6-7pm and
# Sundays between 1-2 am
#/dev/sda -d scsi -s L/../../3/18
#/dev/sdb -d scsi -s L/../../7/01
# Monitor 4 ATA disks connected to a 3ware 6/7/8000 controller which uses
# the 3w-xxxx driver. Start long self-tests Sundays between 1-2, 2-3, 3-4,
# and 4-5 am.
# NOTE: starting with the Linux 2.6 kernel series, the /dev/sdX interface
# is DEPRECATED. Use the /dev/tweN character device interface instead.
# For example /dev/twe0, /dev/twe1, and so on.
#/dev/sdc -d 3ware,0 -a -s L/../../7/01
#/dev/sdc -d 3ware,1 -a -s L/../../7/02
#/dev/sdc -d 3ware,2 -a -s L/../../7/03
#/dev/sdc -d 3ware,3 -a -s L/../../7/04
# Monitor 2 ATA disks connected to a 3ware 9000 controller which
# uses the 3w-9xxx driver (Linux, FreeBSD). Start long self-tests Tuesdays
# between 1-2 and 3-4 am.
#/dev/twa0 -d 3ware,0 -a -s L/../../2/01
#/dev/twa0 -d 3ware,1 -a -s L/../../2/03
# Monitor 2 SATA (not SAS) disks connected to a 3ware 9000 controller which
# uses the 3w-sas driver (Linux). Start long self-tests Tuesdays
# between 1-2 and 3-4 am.
# On FreeBSD /dev/tws0 should be used instead
#/dev/twl0 -d 3ware,0 -a -s L/../../2/01
#/dev/twl0 -d 3ware,1 -a -s L/../../2/03
# Same as above for Windows. Option '-d 3ware,N' is not necessary,
# disk (port) number is specified in device name.
# NOTE: On Windows, DEVICESCAN works also for 3ware controllers.
#/dev/hdc,0 -a -s L/../../2/01
#/dev/hdc,1 -a -s L/../../2/03
# Monitor 3 ATA disks directly connected to a HighPoint RocketRAID. Start long
# self-tests Sundays between 1-2, 2-3, and 3-4 am.
#/dev/sdd -d hpt,1/1 -a -s L/../../7/01
#/dev/sdd -d hpt,1/2 -a -s L/../../7/02
#/dev/sdd -d hpt,1/3 -a -s L/../../7/03
# Monitor 2 ATA disks connected to the same PMPort which connected to the
# HighPoint RocketRAID. Start long self-tests Tuesdays between 1-2 and 3-4 am
#/dev/sdd -d hpt,1/4/1 -a -s L/../../2/01
#/dev/sdd -d hpt,1/4/2 -a -s L/../../2/03
# HERE IS A LIST OF DIRECTIVES FOR THIS CONFIGURATION FILE.
# PLEASE SEE THE smartd.conf MAN PAGE FOR DETAILS
#
# -d TYPE Set the device type: ata, scsi, marvell, removable, 3ware,N, hpt,L/M/N
# -T TYPE set the tolerance to one of: normal, permissive
# -o VAL Enable/disable automatic offline tests (on/off)
# -S VAL Enable/disable attribute autosave (on/off)
# -n MODE No check. MODE is one of: never, sleep, standby, idle
# -H Monitor SMART Health Status, report if failed
# -l TYPE Monitor SMART log. Type is one of: error, selftest
# -f Monitor for failure of any 'Usage' Attributes
# -m ADD Send warning email to ADD for -H, -l error, -l selftest, and -f
# -M TYPE Modify email warning behavior (see man page)
# -s REGE Start self-test when type/date matches regular expression (see man page)
# -p Report changes in 'Prefailure' Normalized Attributes
# -u Report changes in 'Usage' Normalized Attributes
# -t Equivalent to -p and -u Directives
# -r ID Also report Raw values of Attribute ID with -p, -u or -t
# -R ID Track changes in Attribute ID Raw value with -p, -u or -t
# -i ID Ignore Attribute ID for -f Directive
# -I ID Ignore Attribute ID for -p, -u or -t Directive
# -C ID Report if Current Pending Sector count non-zero
# -U ID Report if Offline Uncorrectable count non-zero
# -W D,I,C Monitor Temperature D)ifference, I)nformal limit, C)ritical limit
# -v N,ST Modifies labeling of Attribute N (see man page)
# -a Default: equivalent to -H -f -t -l error -l selftest -C 197 -U 198
# -F TYPE Use firmware bug workaround. Type is one of: none, samsung
# -P TYPE Drive-specific presets: use, ignore, show, showall
# # Comment: text after a hash sign is ignored
# \ Line continuation character
# Attribute ID is a decimal integer 1 <= ID <= 255
# except for -C and -U, where ID = 0 turns them off.
# All but -d, -m and -M Directives are only implemented for ATA devices
#
# If the test string DEVICESCAN is the first uncommented text
# then smartd will scan for devices.
# DEVICESCAN may be followed by any desired Directives.

209
smartmontools/smartd_warning.sh Executable file
View File

@@ -0,0 +1,209 @@
#! /bin/sh
#
# smartd warning script
#
# Home page of code is: http://www.smartmontools.org
#
# Copyright (C) 2012-16 Christian Franke
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# $Id: smartd_warning.sh.in 4839 2018-11-27 18:26:08Z chrfranke $
#
set -e
# Set by config.status
export PATH="/usr/local/bin:/usr/bin:/bin"
PACKAGE="smartmontools"
VERSION="7.1"
prefix="/usr"
sysconfdir="/etc/smartmontools"
smartdscriptdir="${sysconfdir}"
# Default mailer
os_mailer="mail"
# Plugin directory (disabled if empty)
plugindir="${smartdscriptdir}/smartd_warning.d"
# Parse options
dryrun=
case $1 in
--dryrun) dryrun=t; shift ;;
esac
if [ $# != 0 ]; then
cat <<EOF
smartd $VERSION warning message script
Usage:
export SMARTD_MAILER='Path to external script, empty for "$os_mailer"'
export SMARTD_ADDRESS='Space separated mail addresses, empty if none'
export SMARTD_MESSAGE='Error Message'
export SMARTD_FAILTYPE='Type of failure, "EMailTest" for tests'
export SMARTD_TFIRST='Date of first message sent, empty if none'
#export SMARTD_TFIRSTEPOCH='time_t format of above'
export SMARTD_PREVCNT='Number of previous messages, 0 if none'
export SMARTD_NEXTDAYS='Number of days until next message, empty if none'
export SMARTD_DEVICEINFO='Device identify information'
#export SMARTD_DEVICE='Device name'
#export SMARTD_DEVICESTRING='Annotated device name'
#export SMARTD_DEVICETYPE='Device type from -d directive, "auto" if none'
$0 [--dryrun]
EOF
exit 1
fi
if [ -z "${SMARTD_ADDRESS}${SMARTD_MAILER}" ]; then
echo "$0: SMARTD_ADDRESS or SMARTD_MAILER must be set" >&2
exit 1
fi
# Get host and domain names
for cmd in 'hostname' 'echo "[Unknown]"'; do
hostname=`eval $cmd 2>/dev/null` || continue
test -n "$hostname" || continue
break
done
dnsdomain=${hostname#*.}
if [ "$dnsdomain" != "$hostname" ]; then
# hostname command printed FQDN
hostname=${hostname%%.*}
else
for cmd in 'dnsdomainname' 'hostname -d' 'echo'; do
dnsdomain=`eval $cmd 2>/dev/null` || continue
break
done
test "$dnsdomain" != "(none)" || dnsdomain=
fi
for cmd in 'nisdomainname' 'hostname -y' 'domainname' 'echo'; do
nisdomain=`eval $cmd 2>/dev/null` || continue
break
done
test "$nisdomain" != "(none)" || nisdomain=
# Format subject
export SMARTD_SUBJECT="SMART error (${SMARTD_FAILTYPE-[SMARTD_FAILTYPE]}) detected on host: $hostname"
# Format message
fullmessage=`
echo "This message was generated by the smartd daemon running on:"
echo
echo " host name: $hostname"
echo " DNS domain: ${dnsdomain:-[Empty]}"
test -z "$nisdomain" ||
echo " NIS domain: $nisdomain"
#test -z "$USERDOMAIN" ||
# echo " Win domain: $USERDOMAIN"
echo
echo "The following warning/error was logged by the smartd daemon:"
echo
echo "${SMARTD_MESSAGE-[SMARTD_MESSAGE]}"
echo
echo "Device info:"
echo "${SMARTD_DEVICEINFO-[SMARTD_DEVICEINFO]}"
echo
echo "For details see host's SYSLOG."
if [ "$SMARTD_FAILTYPE" != "EmailTest" ]; then
echo
echo "You can also use the smartctl utility for further investigation."
test "$SMARTD_PREVCNT" = "0" ||
echo "The original message about this issue was sent at ${SMARTD_TFIRST-[SMARTD_TFIRST]}"
case $SMARTD_NEXTDAYS in
'') echo "No additional messages about this problem will be sent." ;;
1) echo "Another message will be sent in 24 hours if the problem persists." ;;
*) echo "Another message will be sent in $SMARTD_NEXTDAYS days if the problem persists." ;;
esac
fi
`
# Export message with trailing newline
export SMARTD_FULLMESSAGE="$fullmessage
"
# Run plugin scripts if requested
if test -n "$plugindir"; then
case " $SMARTD_ADDRESS" in
*\ @*)
if [ -n "$dryrun" ]; then
echo "export SMARTD_SUBJECT='$SMARTD_SUBJECT'"
echo "export SMARTD_FULLMESSAGE='$SMARTD_FULLMESSAGE'"
fi
# Run ALL scripts if requested
case " $SMARTD_ADDRESS " in
*\ @ALL\ *)
for cmd in "$plugindir"/*; do
if [ -f "$cmd" ] && [ -x "$cmd" ]; then
if [ -n "$dryrun" ]; then
echo "$cmd </dev/null"
else
"$cmd" </dev/null
fi
fi
done
;;
esac
# Run selected scripts
addrs=$SMARTD_ADDRESS
SMARTD_ADDRESS=
for ad in $addrs; do
case $ad in
@ALL)
;;
@?*)
cmd="$plugindir/${ad#@}"
if [ -f "$cmd" ] && [ -x "$cmd" ]; then
if [ -n "$dryrun" ]; then
echo "$cmd </dev/null"
else
"$cmd" </dev/null
fi
elif [ ! -e "$cmd" ]; then
echo "$cmd: Not found" >&2
fi
;;
*)
SMARTD_ADDRESS="${SMARTD_ADDRESS:+ }$ad"
;;
esac
done
# Send email to remaining addresses
test -n "$SMARTD_ADDRESS" || exit 0
;;
esac
fi
# Send mail or run command
if [ -n "$SMARTD_ADDRESS" ]; then
# Send mail, use platform mailer by default
test -n "$SMARTD_MAILER" || SMARTD_MAILER=$os_mailer
if [ -n "$dryrun" ]; then
echo "exec '$SMARTD_MAILER' -s '$SMARTD_SUBJECT' $SMARTD_ADDRESS <<EOF
$fullmessage
EOF"
else
exec "$SMARTD_MAILER" -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS <<EOF
$fullmessage
EOF
fi
elif [ -n "$SMARTD_MAILER" ]; then
# Run command
if [ -n "$dryrun" ]; then
echo "export SMARTD_SUBJECT='$SMARTD_SUBJECT'"
echo "export SMARTD_FULLMESSAGE='$SMARTD_FULLMESSAGE'"
echo "exec '$SMARTD_MAILER' </dev/null"
else
unset SMARTD_ADDRESS
exec "$SMARTD_MAILER" </dev/null
fi
fi

6
sysconfig/smartmontools Normal file
View File

@@ -0,0 +1,6 @@
# command line options for smartd
# Add -s /var/lib/smartmontools to enable state persistence
smartd_opts="-q never"
# autogenerated config file options
# smartd_conf_opts="-H -m root"

View File

@@ -0,0 +1 @@
/usr/lib/systemd/system/smartd.service