File: sysstat.postinst

package info (click to toggle)
sysstat 4.0.4-1woody2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 760 kB
  • ctags: 565
  • sloc: ansic: 4,569; tcl: 586; makefile: 321; sh: 259; perl: 29
file content (49 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download
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
#! /bin/sh


S_VERSION="3.3.6-1"
set -e

. /usr/share/debconf/confmodule

if [ "$1" = "configure" ] ; then
  if dpkg --compare-versions "$2" lt-nl "$S_VERSION"; then

	RET=""
	db_get sysstat/remove_files || true

	if [ "$RET" = "true" ]; then
		echo "Removing old statistics from /var/log/sysstat." 1>&2 
	 	rm -f /var/log/sysstat/sa[0-9]*
	fi
	
  fi

  # show notice & question next time
  db_reset sysstat/notice || true
  db_reset sysstat/remove_files || true
  db_stop || true

  if dpkg --compare-versions "$2" lt-nl "4.0.0-2"; then
  	# in older versions of sysstat some generated files
  	# might be world writeable... (#95561)
	chmod go-w /var/log/sysstat/sa* >/dev/null 2>&1 || true
  fi

fi


if [ "$1" = "configure" ] ; then

  if ! update-alternatives --display sar | grep -q '^/usr/bin/sar\.sysstat' 
  then
       update-alternatives --install /usr/bin/sar sar /usr/bin/sar.sysstat 0 \
		--slave /usr/share/man/man1/sar.1.gz sar.1.gz \
					/usr/share/man/man1/sar.sysstat.1.gz
  fi
fi

#DEBHELPER#

exit 0