This file is indexed.

preinst is in rsyslog 5.8.6-1ubuntu8.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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

set -e

if [ "$1" = "install" -a -n "$2" ] ; then
	[ -f /etc/logrotate.d/rsyslog.disabled ] && mv -f /etc/logrotate.d/rsyslog.disabled /etc/logrotate.d/rsyslog
fi

if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "5.7.8-1" ; then
	rm -f /etc/systemd/system/sockets.target.wants/rsyslog.socket
fi

disable_profile() {
    APP_CONFFILE="/etc/apparmor.d/usr.sbin.rsyslogd"
    APP_DISABLE="/etc/apparmor.d/disable/usr.sbin.rsyslogd"
    # Create a symlink to the yet-to-be-unpacked profile
    if [ ! -e "$APP_CONFFILE" ]; then
        mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true
        ln -sf $APP_CONFFILE $APP_DISABLE
    fi
}

if [ "$1" = "install" ]; then
    # Disable AppArmor profile on install
    disable_profile
elif [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "5.8.6-1ubuntu5" ; then
    # Disable AppArmor on upgrade from earlier than when we first shipped
    # the profile if the user does not already have a profile defined
    disable_profile
fi

# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
	if [ -e "/etc/init.d/rsyslog" ] && [ ! -L "/etc/init.d/rsyslog" ]; then
		if [ "`md5sum \"/etc/init.d/rsyslog\" | sed -e \"s/ .*//\"`" != \
		     "`dpkg-query -W -f='${Conffiles}' rsyslog | sed -n -e \"\\\\' /etc/init.d/rsyslog '{s/ obsolete$//;s/.* //p}\"`" ]
		then
			echo "Obsolete conffile /etc/init.d/rsyslog has been modified by you, renaming to .dpkg-bak"
			mv -f "/etc/init.d/rsyslog" "/etc/init.d/rsyslog.dpkg-bak"
		else
			rm -f "/etc/init.d/rsyslog"
		fi
	fi
fi
# End automatically added section


exit 0