~ubuntu-branches/ubuntu/trusty/syslog-ng/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/syslog-ng.init

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS), Gergely Nagy
  • Date: 2011-10-11 14:30:48 UTC
  • mfrom: (1.3.7)
  • Revision ID: package-import@ubuntu.com-20111011143048-r1iljux9xbvj3lwh
Tags: 3.3.1.dfsg-1
* New upstream release with important fixes from upstream git tree with
  non-free manpages removed.
* Drop syslog-ng.conf(5) (closes: #496521).
* syslog-ng(8) is generated, and does not mention -Q anymore
  (closes: #616069).
* Supports CAP_SYSLOG on recent kernels (closes: #630172).
* Does not use g_timeout_add_seconds anymore (closes: #609154).

[ Gergely Nagy <algernon@madhouse-project.org> ]
* Update debian/copyright to DEP-5 format.
* Simplified the logrotate file by merging identical entries.
* Include local configuration files from /etc/syslog-ng/conf.d/ (Closes:
  #609050).
* Update syslog-ng.conf to be fully 3.3 compliant.
* Compress both source and binaries (except the syslog-ng meta
  package) with xz, instead of gzip.
* Use dpkg triggers to restart syslog-ng when appropriate.
* Include DFSG-free manual pages for all binaries.
* Build with Hardening enabled.
* Mention syslog(3) in /etc/default/syslog-ng, instead of
  <linux/kernel.h> (Closes: #608605)
* Support 'status' in the init script.
  Patch from Peter Eisentraut <petere@debian.org> (Closes: #644458)
* Build-Depend on libevtlog-dev (>= 0.2.12-5~) for correct shlibs.
* Use [linux-any] in Build-Depends instead of hardcoded links.
  (Closes: #634715)
* Use $SYSLOGNG_OPTS in the init script when reloading syslog-ng.
  (Closes: #589081)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
### BEGIN INIT INFO
3
 
# Provides:          syslog-ng
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
7
 
# Default-Stop:      0 1 6
8
 
# Short-Description: Starting system logging daemon
9
 
# Description:       Starting syslog-NG, the next generation
10
 
#  syslog daemon.
11
 
### END INIT INFO#
12
 
#
13
 
# skeleton      example file to build /etc/init.d/ scripts.
14
 
#               This file should be used to construct scripts for /etc/init.d.
15
 
#
16
 
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
17
 
#               Modified for Debian GNU/Linux
18
 
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
19
 
#
20
 
# Version:      @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
21
 
# This file was customized by SZALAY Attila <sasa@debian.org>
22
 
 
23
 
SYSLOGNG_OPTS=""
24
 
 
25
 
#we source /etc/default/syslog-ng if exists
26
 
[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng
27
 
 
28
 
# stop syslog-ng before changing its PID file!
29
 
PIDFILE="/var/run/syslog-ng.pid"
30
 
 
31
 
SYSLOGNG="/usr/sbin/syslog-ng"
32
 
NAME="syslog-ng"
33
 
 
34
 
PATH=/sbin:/bin:/usr/sbin:/usr/bin
35
 
test -f $SYSLOGNG || exit 0
36
 
 
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
40
 
 
41
 
case "x$CONSOLE_LOG_LEVEL" in
42
 
  x[1-8])
43
 
    dmesg -n $CONSOLE_LOG_LEVEL
44
 
    ;;
45
 
  x)
46
 
    ;;
47
 
  *)
48
 
    log_warning_msg "CONSOLE_LOG_LEVEL is of unaccepted value."
49
 
    ;;
50
 
esac
51
 
 
52
 
create_xconsole() {
53
 
  if [ ! -e /dev/xconsole ]
54
 
  then
55
 
    mknod -m 640 /dev/xconsole p
56
 
  fi
57
 
}
58
 
 
59
 
create_pidfiledir() {
60
 
  if [ ! -d /var/run/syslog-ng ]
61
 
  then
62
 
    mkdir -p /var/run/syslog-ng
63
 
  fi
64
 
}
65
 
                                
66
 
syslogng_start() {
67
 
    log_daemon_msg "Starting system logging" "$NAME"
68
 
    create_xconsole
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
72
 
    RET="$?"
73
 
    log_end_msg $RET
74
 
    return $RET
75
 
    
76
 
}
77
 
 
78
 
syslogng_stop() {
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 \
82
 
                      --pidfile "$PIDFILE"
83
 
    RET="$?"
84
 
    log_end_msg $RET
85
 
    rm -f "$PIDFILE"
86
 
    return $RET
87
 
}
88
 
 
89
 
syslogng_reload() {
90
 
    log_daemon_msg "Reload system logging" "$NAME"
91
 
    if $SYSLOGNG -s $SYSLOGNG_OPTS
92
 
    then
93
 
      start-stop-daemon --stop --signal 1 --quiet --exec "$SYSLOGNG" \
94
 
                        --pidfile "$PIDFILE"
95
 
      RET="$?"
96
 
      log_end_msg $RET
97
 
      return $RET
98
 
    else
99
 
      log_end_msg 1
100
 
      return 1
101
 
    fi
102
 
}
103
 
 
104
 
 
105
 
case "$1" in
106
 
  start)
107
 
    create_pidfiledir
108
 
    syslogng_start || exit 1
109
 
    ;;
110
 
  stop)
111
 
    syslogng_stop || exit 1
112
 
    ;;
113
 
  reload|force-reload)
114
 
    syslogng_reload || exit 1
115
 
    ;;
116
 
  restart)
117
 
    syslogng_stop
118
 
    sleep 1
119
 
    syslogng_start || exit 1
120
 
    ;;
121
 
  *)
122
 
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
123
 
    exit 1
124
 
    ;;
125
 
esac
126
 
 
127
 
exit 0
128