File: postinst

package info (click to toggle)
sysklogd 1.3-26
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 376 kB
  • ctags: 261
  • sloc: ansic: 3,532; makefile: 133; sh: 125; perl: 66
file content (60 lines) | stat: -rw-r--r-- 1,220 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
#! /bin/sh

set -e

if [ -z "`ls /dev/xconsole 2> /dev/null`" ]; then
  mknod -m 644 /dev/xconsole p
fi

if [ ! -d /var/log/news \
       -a `grep '^news:' /etc/passwd |wc -l` -gt 0 \
       -a `grep '^news:' /etc/group |wc -l` -gt 0 ]; then
    mkdir /var/log/news
    chmod 2755 /var/log/news
    chown news.news /var/log/news
fi

if [ "$1" = "upgrade" ]
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
    test -f /etc/init.d/sysklogd && sh /etc/init.d/sysklogd stop

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

    if `grep -q /var/log/auth.log /etc/syslog.conf` ; then
	if [ ! -f /var/log/auth.log ]; then
	    touch /var/log/auth.log
	    chown root.adm /var/log/auth.log
	    chmod o-rwx /var/log/auth.log
	fi
    fi

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

    # restarting daemon
    #
    if [ -x /etc/init.d/sysklogd ]; then
	  /etc/init.d/sysklogd start
    fi
fi

exit 0