~ubuntu-branches/ubuntu/karmic/rsyslog/karmic

« back to all changes in this revision

Viewing changes to debian/rsyslog.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2009-06-29 08:37:43 UTC
  • Revision ID: james.westby@ubuntu.com-20090629083743-jni3dxxoabiuq34y
Tags: 4.2.0-1ubuntu1
* Run as rsyslog:rsyslog (LP: #250827, LP: #388608)
  - debian/control: Depend on adduser
  - debian/rsyslog.postinst: Create syslog user
  - debian/rsyslog.postrm: Delete syslog user on purge
  - debian/rsyslog.conf: Use DropPriv config fields
* Allow reading /proc/kmsg when non-root
  - debian/rsyslog.init: Spawn a dd instance that shovels the /proc/kmsg
    data to a pipe that rsyslog can read (based on Martin Pitt's similar
    change to sysklogd).
  - debian/patches/deroot.patch: Support a KLogPath config field
    to change where the klog plugin looks and only start input modules
    after we drop privileges, as reading when root interferes with
    future reads as syslog.
  - debian/rsyslog.conf: Use KLogPath field to point to dd pipe
* Cleanly upgrade from sysklogd
  - debian/default.conf, debian/rsyslog.conf:
    Break out the default rules into their own config file
  - debian/rsyslog.install: Install it in /usr/share/rsyslog
  - debian/rsyslog.postinst: If present, copy /etc/syslog.conf into
    /etc/rsyslog.d/default.conf.  Then merge our own default.conf

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
                        fi
67
67
                done
68
68
        fi
 
69
 
 
70
        local user_conf=/etc/rsyslog.d/50-default.conf
 
71
        local default_conf=/usr/share/rsyslog/50-default.conf
 
72
 
 
73
        # Upgrade handling for config file.  We copy syslog.conf if it exists and
 
74
        # is modified, else use our default fresh-install config.
 
75
        if dpkg --compare-versions "$2" lt "3.22.0-1ubuntu1"; then
 
76
                local pkg_name=sysklogd
 
77
                local old_conf=/etc/syslog.conf
 
78
                if [ -e $old_conf ]; then
 
79
                        local md5sum="`md5sum \"$old_conf\" | sed -e \"s/ .*//\"`"
 
80
                        local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $pkg_name | \
 
81
                          sed -n -e "\' $old_conf ' { s/ obsolete$//; s/.* //; p }")"
 
82
                        if [ "$md5sum" != "$old_md5sum" ]; then
 
83
                                cp -n $old_conf $user_conf
 
84
                        fi
 
85
                fi
 
86
        fi
 
87
 
 
88
        ucf --three-way --debconf-ok $default_conf $user_conf
 
89
        ucfr rsyslog $user_conf
 
90
 
 
91
        adduser --system --group --no-create-home --quiet syslog || true
69
92
    ;;
70
93
 
71
94
    abort-upgrade|abort-remove|abort-deconfigure)