/etc/init.d/syslog-ng is in syslog-ng-core 3.5.6-2.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | #! /bin/sh
### BEGIN INIT INFO
# Provides: syslog-ng
# Required-Start: $local_fs $network $time $remote_fs
# Required-Stop: $local_fs $network $time $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starting system logging daemon
# Description: Starting syslog-NG, the next generation
# syslog daemon.
### END INIT INFO#
set -e
SYSLOGNG_OPTS=""
#we source /etc/default/syslog-ng if exists
[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng
# stop syslog-ng before changing its PID file!
PIDFILE="/var/run/syslog-ng.pid"
SYSLOGNG="/usr/sbin/syslog-ng"
NAME="syslog-ng"
PATH=/sbin:/bin:/usr/sbin:/usr/bin
test -f $SYSLOGNG || exit 0
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
case "x$CONSOLE_LOG_LEVEL" in
x[1-8])
dmesg -n $CONSOLE_LOG_LEVEL
;;
x)
;;
*)
log_warning_msg "CONSOLE_LOG_LEVEL is of unaccepted value."
;;
esac
create_xconsole() {
XCONSOLE=/dev/xconsole
if [ "$(uname -s)" = "GNU/kFreeBSD" ]; then
XCONSOLE=/var/run/xconsole
ln -sf $XCONSOLE /dev/xconsole
fi
if [ ! -e $XCONSOLE ]; then
mknod -m 640 $XCONSOLE p
chown root:adm $XCONSOLE
[ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE
fi
}
create_pidfiledir() {
if [ ! -d /var/run/syslog-ng ]
then
mkdir -p /var/run/syslog-ng
fi
}
syslogng_wait() {
if [ "$2" -ne 0 ]; then
return 1
fi
if [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
return 0
fi
RET=1
for i in $(seq 1 30); do
status=0
syslog-ng-ctl stats >/dev/null 2>&1 || status=$?
if [ "$status" != "$1" ]; then
RET=0
break
fi
sleep 1s
done
return $RET
}
syslogng_start() {
log_daemon_msg "Starting system logging" "$NAME"
create_pidfiledir
create_xconsole
start-stop-daemon --start --oknodo --quiet --exec "$SYSLOGNG" \
--pidfile "$PIDFILE" -- -p "$PIDFILE" $SYSLOGNG_OPTS
syslogng_wait 1 $?
RET="$?"
log_end_msg $RET
return $RET
}
syslogng_stop() {
log_daemon_msg "Stopping system logging" "$NAME"
start-stop-daemon --stop --oknodo --quiet --name "$NAME" --retry 3 \
--pidfile "$PIDFILE"
syslogng_wait 0 $?
RET="$?"
log_end_msg $RET
return $RET
}
syslogng_reload() {
log_daemon_msg "Reload system logging" "$NAME"
if $SYSLOGNG -s $SYSLOGNG_OPTS
then
start-stop-daemon --stop --signal 1 --quiet --exec "$SYSLOGNG" \
--pidfile "$PIDFILE"
syslogng_wait 1 $?
RET="$?"
log_end_msg $RET
return $RET
else
log_end_msg 1
return 1
fi
}
case "$1" in
start)
syslogng_start || exit 1
;;
stop)
syslogng_stop || exit 1
;;
reload|force-reload)
syslogng_reload || exit 1
;;
restart)
syslogng_stop
syslogng_start || exit 1
;;
status)
status_of_proc "$SYSLOGNG" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0
|