File: postinst

package info (click to toggle)
sysklogd 1.3-31
  • links: PTS
  • area: main
  • in suites: slink
  • size: 404 kB
  • ctags: 265
  • sloc: ansic: 3,697; perl: 158; makefile: 143; sh: 139
file content (76 lines) | stat: -rw-r--r-- 1,281 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
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
#! /bin/sh

set -e

if [ -z "`ls /dev/xconsole 2> /dev/null`" ]; then
    mknod -m 640 /dev/xconsole p
    chown root.adm /dev/xconsole
fi

if [ ! -d /var/log/news ] \
	&&  grep -q ^news: /etc/passwd \
	&& grep -q ^news: /etc/group 
then
    mkdir /var/log/news
    chmod 2755 /var/log/news
    chown news.news /var/log/news
fi

if [ "$1" = "configure" ]
then
    case $2 in
	1.2-*)
cat<<EOT
The default behaviour of syslogd has altered from 1.2 to 1.3.  By default
*no* messages from the UDP port are accepted.

Read the documentation in /usr/doc/sysklogd carefully.  Some important
things have been changed!

Press [Enter] to continue
EOT
	read xyz
	;;
  esac
fi

if [ "$1" = "configure" ]
then
    if [ -f /etc/init.d/sysklogd ]
    then
	set +e
	sh /etc/init.d/sysklogd stop
	set -e
    fi


    update-rc.d sysklogd defaults 10 90 >/dev/null

    # Create logfiles with correct file modes
    #
    for LOG in `syslogd-listfiles` `syslogd-listfiles --auth`
    do
	if [ ! -f $LOG ]; then
	    touch $LOG
	fi
	chown root.adm $LOG
	chmod 640 $LOG
    done

    # Tidying up some old stuff
    #
    rm -f /etc/rc?.d/[SK]*.syslogd

    # 

    # restarting daemon
    #
    if [ -f /etc/init.d/sysklogd ]
    then
	set +e
	sh /etc/init.d/sysklogd start
	set -e
    fi
fi

exit 0