saving uncommitted changes in /etc prior to emerge run

This commit is contained in:
hasufell 2015-08-09 20:24:44 +02:00 committed by Hans Wurst
parent da265060d3
commit f44a71ee7f
4 changed files with 140 additions and 0 deletions

59
init.d/._cfg0000_syslog-ng Executable file
View File

@ -0,0 +1,59 @@
#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
SYSLOG_NG_CONFIGFILE=${SYSLOG_NG_CONFIGFILE:-/etc/syslog-ng/${RC_SVCNAME}.conf}
SYSLOG_NG_STATEFILE_DIR=${SYSLOG_NG_STATEFILE_DIR:-/var/lib/syslog-ng}
SYSLOG_NG_STATEFILE=${SYSLOG_NG_STATEFILE:-${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.persist}
SYSLOG_NG_PIDFILE_DIR=${SYSLOG_NG_PIDFILE_DIR:-/run}
SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE:-${SYSLOG_NG_PIDFILE_DIR}/${RC_SVCNAME}.pid}
SYSLOG_NG_GROUP=${SYSLOG_NG_GROUP:-root}
SYSLOG_NG_USER=${SYSLOG_NG_USER:-root}
command="/usr/sbin/syslog-ng"
command_args="--persist-file \"${SYSLOG_NG_STATEFILE}\" --cfgfile \"${SYSLOG_NG_CONFIGFILE}\" --pidfile \"${SYSLOG_NG_PIDFILE}\" ${SYSLOG_NG_OPTS}"
extra_commands="checkconfig"
extra_started_commands="reload"
pidfile="${SYSLOG_NG_PIDFILE}"
start_stop_daemon_args="--user \"${SYSLOG_NG_USER}\":\"${SYSLOG_NG_GROUP}\""
description="Syslog-ng is a syslog replacement with advanced filtering features."
description_checkconfig="Check the configuration file that will be used by \"start\""
description_reload="Reload the configuration without exiting"
required_files="${SYSLOG_NG_CONFIGFILE}"
required_dirs="${SYSLOG_NG_PIDFILE_DIR}"
depend() {
use clock
need hostname localmount
after bootmisc
provide logger
}
checkconfig() {
ebegin "Checking your configfile (${SYSLOG_NG_CONFIGFILE})"
syslog-ng -s -f "${SYSLOG_NG_CONFIGFILE}"
eend $? "Configuration error. Please fix your configfile (${SYSLOG_NG_CONFIGFILE})"
}
start_pre() {
checkconfig || return 1
checkpath \
-d \
--mode 0700 \
--owner "${SYSLOG_NG_USER}:${SYSLOG_NG_GROUP}" \
"${SYSLOG_NG_STATEFILE_DIR}"
}
stop_pre() {
[ "$RC_CMD" = restart ] && sleep 1
return 0
}
reload() {
checkconfig || return 1
ebegin "Reloading configuration and re-opening log files"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}

View File

@ -0,0 +1,13 @@
# $Id$
#
# Syslog-ng logrotate snippet for Gentoo Linux
# contributed by Michael Sterrett
#
/var/log/messages {
missingok
sharedscripts
postrotate
/etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
endscript
}

View File

@ -0,0 +1,31 @@
#############################################################################
# Copyright (c) 2010-2014 BalaBit IT Ltd, Budapest, Hungary
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published
# by the Free Software Foundation, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# As an additional exemption you are allowed to compile & link against the
# OpenSSL libraries as published by the OpenSSL project. See the file
# COPYING for details.
#
#############################################################################
#
# This file is placed into /etc/syslog-ng in order to make it trivial to
# include in user written syslog-ng.conf files. It sets up 'scl-root' and
# `include-path`, then includes all SCL supplied plugins.
#
@define scl-root "`syslog-ng-data`/include/scl"
@define include-path "`include-path`:`syslog-ng-data`/include"
@include 'scl/*/*.conf'

View File

@ -0,0 +1,37 @@
@version: 3.6
# $Id$
#
# Syslog-ng default configuration file for Gentoo Linux
# https://bugs.gentoo.org/show_bug.cgi?id=426814
@include "scl.conf"
options {
threaded(yes);
chain_hostnames(no);
# The default action of syslog-ng is to log a STATS line
# to the file every 10 minutes. That's pretty ugly after a while.
# Change it to every 12 hours so you get a nice daily update of
# how many messages syslog-ng missed (0).
stats_freq(43200);
# The default action of syslog-ng is to log a MARK line
# to the file every 20 minutes. That's seems high for most
# people so turn it down to once an hour. Set it to zero
# if you don't want the functionality at all.
mark_freq(3600);
};
source src { system(); internal(); };
destination messages { file("/var/log/messages"); };
# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
# ...if you intend to use /dev/console for programs like xconsole
# you can comment out the destination line above that references /dev/tty12
# and uncomment the line below.
#destination console_all { file("/dev/console"); };
log { source(src); destination(messages); };
log { source(src); destination(console_all); };