File: syslog-ng.postinst

package info (click to toggle)
syslog-ng 2.0.0-1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,844 kB
  • ctags: 2,014
  • sloc: ansic: 9,125; xml: 2,125; sh: 1,210; yacc: 741; lex: 278; makefile: 191; awk: 94; python: 85; perl: 49
file content (44 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -e

if [ -x /etc/init.d/sysklogd ]
then
   /etc/init.d/sysklogd stop
fi

if [ "$1" = "configure" -a "$2" != "" ] && dpkg --compare-versions "$2" lt "1.4.6"
then
	dpkg-divert --package syslog-ng --remove --rename --divert /etc/init.d/sysklogd.syslog-ng /etc/init.d/sysklogd
	dpkg-divert --package syslog-ng --remove --rename --divert /etc/cron.daily/sysklogd.syslog-ng /etc/cron.daily/sysklogd
	dpkg-divert --package syslog-ng --remove --rename --divert /etc/cron.weekly/sysklogd.syslog-ng /etc/cron.weekly/sysklogd
fi

if [ "$1" = "configure" -a "$2" != "" ] && \
	dpkg --compare-versions "$2" lt "1.5.19" && \
	dpkg --compare-versions "$2" gt "1.5.8-2"
then
	echo "Please restart all programs that may be logging, as"
	echo "the /dev/log socket type has changed"
fi

#DEBHELPER#

if [ "$1" = "configure" ]
then
	if [ -z "$2" ]
	then
		COMMAND="start"
	else
		COMMAND="restart"
	fi
	if [ -x "/etc/init.d/syslog-ng" ]; then
		if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
			invoke-rc.d syslog-ng $COMMAND ||true
		else
			/etc/init.d/syslog-ng $COMMAND ||true
		fi
	fi
fi
                                                                
exit 0