2015-02-27 00:58:55 +00:00
|
|
|
#!/sbin/runscript
|
2015-07-31 00:55:23 +00:00
|
|
|
# Copyright 1999-2015 Gentoo Foundation
|
2015-02-27 00:58:55 +00:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-07-31 00:55:23 +00:00
|
|
|
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/3.6/syslog-ng.rc6,v 1.3 2015/03/29 07:27:06 mr_bones_ Exp $
|
2015-02-27 00:58:55 +00:00
|
|
|
|
|
|
|
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}
|
2015-07-31 00:55:23 +00:00
|
|
|
SYSLOG_NG_PIDFILE_DIR=${SYSLOG_NG_PIDFILE_DIR:-/run}
|
2015-02-27 00:58:55 +00:00
|
|
|
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() {
|
2015-07-31 00:55:23 +00:00
|
|
|
checkconfig || return 1
|
|
|
|
checkpath \
|
|
|
|
-d \
|
|
|
|
--mode 0700 \
|
|
|
|
--owner "${SYSLOG_NG_USER}:${SYSLOG_NG_GROUP}" \
|
|
|
|
"${SYSLOG_NG_STATEFILE_DIR}"
|
2015-02-27 00:58:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop_pre() {
|
2015-07-31 00:55:23 +00:00
|
|
|
[ "$RC_CMD" = restart ] && sleep 1
|
|
|
|
return 0
|
2015-02-27 00:58:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
checkconfig || return 1
|
|
|
|
ebegin "Reloading configuration and re-opening log files"
|
|
|
|
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
|
|
|
eend $?
|
|
|
|
}
|