From: Frank Brehm Date: Tue, 5 Apr 2016 20:58:52 +0000 (+0200) Subject: saving uncommitted changes in /etc prior to emerge run X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=a1e56deb15a51c4d2cf0427b7f83a315ef85672e;p=config%2Fbruni%2Fetc.git saving uncommitted changes in /etc prior to emerge run --- diff --git a/audisp/audisp-remote.conf b/audisp/audisp-remote.conf index 608e0708..70d8a992 100644 --- a/audisp/audisp-remote.conf +++ b/audisp/audisp-remote.conf @@ -20,7 +20,7 @@ network_failure_action = stop disk_low_action = ignore disk_full_action = ignore disk_error_action = syslog -remote_ending_action = suspend +remote_ending_action = reconnect generic_error_action = syslog generic_warning_action = syslog overflow_action = syslog diff --git a/audisp/audispd.conf b/audisp/audispd.conf index eff41037..ee50e5b3 100644 --- a/audisp/audispd.conf +++ b/audisp/audispd.conf @@ -3,7 +3,7 @@ # dispatcher daemon, audispd. # -q_depth = 120 +q_depth = 150 overflow_action = SYSLOG priority_boost = 4 max_restarts = 10 diff --git a/audit/audit.rules b/audit/audit.rules index b2b4f02f..a53a7036 100644 --- a/audit/audit.rules +++ b/audit/audit.rules @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/audit.rules-2.1.3,v 1.1 2011/09/11 02:58:55 robbat2 Exp $ +# $Id$ # # This file contains the auditctl rules that are loaded # whenever the audit daemon is started via the initscripts. diff --git a/audit/audit.rules.stop.post b/audit/audit.rules.stop.post index 34db08cd..04d81dda 100644 --- a/audit/audit.rules.stop.post +++ b/audit/audit.rules.stop.post @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/audit.rules.stop.post,v 1.1 2006/06/22 07:41:46 robbat2 Exp $ +# $Id$ # # This file contains the auditctl rules that are loaded immediately after the # audit deamon is stopped via the initscripts. diff --git a/audit/audit.rules.stop.pre b/audit/audit.rules.stop.pre index c5fb4f94..7fc0d84d 100644 --- a/audit/audit.rules.stop.pre +++ b/audit/audit.rules.stop.pre @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/audit.rules.stop.pre,v 1.2 2011/09/11 02:58:55 robbat2 Exp $ +# $Id$ # # This file contains the auditctl rules that are loaded immediately before the # audit deamon is stopped via the initscripts. diff --git a/audit/rules.d/audit.rules b/audit/rules.d/audit.rules new file mode 100644 index 00000000..479ff470 --- /dev/null +++ b/audit/rules.d/audit.rules @@ -0,0 +1,14 @@ +# This file contains the auditctl rules that are loaded +# whenever the audit daemon is started via the initscripts. +# The rules are simply the parameters that would be passed +# to auditctl. + +# First rule - delete all +-D + +# Increase the buffers to survive stress events. +# Make this bigger for busy systems +-b 320 + +# Feel free to add below this line. See auditctl man page + diff --git a/conf.d/auditd b/conf.d/auditd index b5f389ea..923e9378 100644 --- a/conf.d/auditd +++ b/conf.d/auditd @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/auditd-conf.d-2.1.3,v 1.1 2011/09/11 02:58:55 robbat2 Exp $ +# $Id$ # Configuration options for auditd # -f for foreground mode diff --git a/init.d/auditd b/init.d/auditd index 6ac218d6..33c932a2 100755 --- a/init.d/auditd +++ b/init.d/auditd @@ -1,7 +1,7 @@ -#!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/auditd-init.d-2.1.3,v 1.1 2011/09/11 02:58:55 robbat2 Exp $ +# $Id$ extra_started_commands='reload reload_auditd reload_rules' description='Linux Auditing System' @@ -15,18 +15,18 @@ command='/sbin/auditd' start_auditd() { # Env handling taken from the upstream init script - if [ -z "$AUDITD_LANG" -o "$AUDITD_LANG" = "none" -o "$AUDITD_LANG" = "NONE" ]; then - unset LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE - else - LANG="$AUDITD_LANG" - LC_TIME="$AUDITD_LANG" - LC_ALL="$AUDITD_LANG" - LC_MESSAGES="$AUDITD_LANG" - LC_NUMERIC="$AUDITD_LANG" - LC_MONETARY="$AUDITD_LANG" - LC_COLLATE="$AUDITD_LANG" - export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE - fi + if [ -z "$AUDITD_LANG" -o "$AUDITD_LANG" = "none" -o "$AUDITD_LANG" = "NONE" ]; then + unset LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE + else + LANG="$AUDITD_LANG" + LC_TIME="$AUDITD_LANG" + LC_ALL="$AUDITD_LANG" + LC_MESSAGES="$AUDITD_LANG" + LC_NUMERIC="$AUDITD_LANG" + LC_MONETARY="$AUDITD_LANG" + LC_COLLATE="$AUDITD_LANG" + export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE + fi unset HOME MAIL USER USERNAME ebegin "Starting ${name}" @@ -38,7 +38,7 @@ start_auditd() { return $ret } -stop_auditd() { +stop_auditd() { ebegin "Stopping ${name}" start-stop-daemon --stop --quiet --pidfile ${pidfile} local ret=$? @@ -46,12 +46,11 @@ stop_auditd() { return $ret } - loadfile() { local rules="$1" if [ -n "${rules}" -a -f "${rules}" ]; then einfo "Loading audit rules from ${rules}" - /sbin/auditctl -R "${rules}" 1>/dev/null + /sbin/auditctl -R "${rules}" >/dev/null return $? else return 0 @@ -62,7 +61,6 @@ start() { start_auditd local ret=$? if [ $ret -eq 0 -a "${RC_CMD}" != "restart" ]; then - touch /var/lock/subsys/${name} loadfile "${RULEFILE_STARTUP}" fi return $ret @@ -73,7 +71,10 @@ reload_rules() { } reload_auditd() { - [ -f ${pidfile} ] && kill -HUP `cat ${pidfile}` + ebegin "Reloading ${SVCNAME}" + start-stop-daemon --signal HUP \ + --exec "${command}" --pidfile "${pidfile}" + eend $? } reload() { @@ -84,14 +85,7 @@ reload() { stop() { [ "${RC_CMD}" != "restart" ] && loadfile "${RULEFILE_STOP_PRE}" stop_auditd - rm -f /var/lock/subsys/${name} local ret=$? [ "${RC_CMD}" != "restart" ] && loadfile "${RULEFILE_STOP_POST}" return $ret } - -# This is a special case, we do not want to touch the rules at all -restart() { - stop_auditd - start_auditd -}