~ubuntu-branches/ubuntu/feisty/syslog-ng/feisty-security

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