File: postinst

package info (click to toggle)
mon 0.99.2-9%2Betch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 908 kB
  • ctags: 299
  • sloc: perl: 9,801; ansic: 778; sh: 372; makefile: 122
file content (86 lines) | stat: -rw-r--r-- 2,591 bytes parent folder | download | duplicates (3)
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
#!/bin/sh -e

# $Id: postinst,v 1.7 2002/06/03 18:52:50 roderick Exp $

# Create local mon.d/alert.d, but don't fail if it fails.

for dir in lib lib/mon lib/mon/mon.d lib/mon/alert.d
do
    dir=/usr/local/$dir
    if mkdir $dir 2>/dev/null
    then
    	chown root:staff $dir
	chmod 2775 $dir
    fi
done

# Before 0.38.14 the daemon ran as daemon.daemon and the directories
# it had to write to were root.daemon set-gid.  After it runs as
# daemon.shadow and the directories are owned by daemon.

if [ x-"$1" = x-configure -a -n "$2" ] &&
	dpkg --compare-versions "$2" lt 0.38.14
then
    dirs='/var/log/mon /var/run/mon /var/state/mon'
    chown -R daemon:root $dirs
    chmod 755 $dirs
fi

if [ x-"$1" = x-configure -a -n "$2" ] &&
	dpkg --compare-versions "$2" lt 0.99.1
then
    msg=
    while :
    do
    	{
	    [ -n "$msg" ] && {
		echo "$msg"
		echo
	    }
	    echo "\
You're upgrading mon from version $2.  Version 0.99.1 of mon made some
changes to its default behavior:

    - The old \"comp_alerts\" behavior for a period section is now
      the default.  This means you won't get an upalert unless the
      corresponding alert was triggered.  To get the old behavior,
      specify \"no_comp_alerts\" in the period section.

    - The old \"summary\" option for alertevery is now the default.
      This means that a monitor failure which leaves the summary
      line (first line of output) the same but changes the body
      doesn't trigger a new alert.  To get the old behavior, append
      \"no_summary\" to the alertevery line.

The corresponding old options in mon.cf (\"comp_alerts\" and \"alertevery
... summary\") are accepted, but they don't do anything.

If you need to change your mon.cf, you can you can either make your
changes while I wait (from another window or the like), or I can abort
the configuration of the new mon package so the daemon won't be started.
NB:  The mon daemon will still be started after the next system reboot,
even if dpkg doesn't finish configuration of the mon package.

The new behavior is generally more useful, and most people will want
simply to leave their mon.cf as-is and continue with configuration so as
to use the new defaults."
    	} | ${PAGER:-pager}
    	echo
    	echo -n "Continue with configuration of new mon package? (Y/N) "
	read response
	case $response in
	    [Yy])
	    	break;;
	    [Nn])
		echo
	    	echo "\
Aborting.  You can use \"dpkg --configure mon\" to finish configuration
after updating your mon.cf."
		exit 1;;
	    *)
	    	msg="Please respond with Y or N.";;
	esac
    done
fi

#DEBHELPER#