File: mon.postinst

package info (click to toggle)
mon 1.2.0-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,860 kB
  • ctags: 538
  • sloc: perl: 15,847; ansic: 774; sh: 330; makefile: 46
file content (48 lines) | stat: -rw-r--r-- 1,283 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
#!/bin/sh
#
# Author: Dario Minnucci <midget@debian.org>
# Date:   Fri, 29 Jun 2007 02:51:52 +0200
#
#         'mon' user creation in configure step.
#

set -e

#echo "----------------------------------------------"
#echo " debian/mon.postinst: $1"
#echo "----------------------------------------------"

case "$1" in
    configure)

	chown mon:root "/var/log/mon"

	#
	# Check if pidfile directory already exists and change ownership"
	#
	if [ -d "/var/run/mon" ] ; then
		############################################################
		# Compativility with versions older than 0.99.2-12:
		############################################################
		# On previous versions, /var/run/mon directory ownership was 
		# set to 'daemon:root' in order to manage the pidfile.
		# With the introduction of the user 'mon', the init script
		# switches to user 'mon' before starting the daemon startup
		# process. Because of this, we need to change the directory
		# ownership to ensure the pidfile is created.
		############################################################
		chown mon:root "/var/run/mon"
	fi 
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#