4
# Required-Start: $local_fs $network $time $remote_fs
5
# Required-Stop: $local_fs $network $time $remote_fs
6
# Default-Start: 2 3 4 5
8
# Short-Description: Starting system logging daemon
9
# Description: Starting syslog-NG, the next generation
13
# skeleton example file to build /etc/init.d/ scripts.
14
# This file should be used to construct scripts for /etc/init.d.
16
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
17
# Modified for Debian GNU/Linux
18
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
20
# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
21
# This file was customized by SZALAY Attila <sasa@debian.org>
25
#we source /etc/default/syslog-ng if exists
26
[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng
28
# stop syslog-ng before changing its PID file!
29
PIDFILE="/var/run/syslog-ng.pid"
31
SYSLOGNG="/usr/sbin/syslog-ng"
34
PATH=/sbin:/bin:/usr/sbin:/usr/bin
35
test -f $SYSLOGNG || exit 0
37
# Define LSB log_* functions.
38
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
39
. /lib/lsb/init-functions
41
case "x$CONSOLE_LOG_LEVEL" in
43
dmesg -n $CONSOLE_LOG_LEVEL
48
log_warning_msg "CONSOLE_LOG_LEVEL is of unaccepted value."
53
if [ ! -e /dev/xconsole ]
55
mknod -m 640 /dev/xconsole p
60
if [ ! -d /var/run/syslog-ng ]
62
mkdir -p /var/run/syslog-ng
67
log_daemon_msg "Starting system logging" "$NAME"
69
[ -f "$PIDFILE" ] && echo ' seems to be running' && return 0
70
start-stop-daemon --start --quiet --exec "$SYSLOGNG" \
71
--pidfile "$PIDFILE" -- -p "$PIDFILE" $SYSLOGNG_OPTS
79
log_daemon_msg "Stopping system logging" "$NAME"
80
[ ! -f "$PIDFILE" ] && echo ' seems to be stopped already' && return 0
81
start-stop-daemon --stop --quiet --name "$NAME" --retry 3 \
90
log_daemon_msg "Reload system logging" "$NAME"
91
if $SYSLOGNG -s $SYSLOGNG_OPTS
93
start-stop-daemon --stop --signal 1 --quiet --exec "$SYSLOGNG" \
108
syslogng_start || exit 1
111
syslogng_stop || exit 1
114
syslogng_reload || exit 1
119
syslogng_start || exit 1
122
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2