postinst is in xrdp 0.9.5-2.
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 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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | #!/bin/sh
set -e
# This maintainer script can be called the following ways:
#
# * new-postinst "configure" [$most_recently_configured_version]
# The package is unpacked; all dependencies are unpacked and, when there
# are no circular dependencies, configured.
#
# * old-postinst "abort-upgrade" $new_version
# * conflictors-postinst "abort-remove" "in-favour" $package
# $new_version
# * postinst "abort-remove"
# * deconfigureds-postinst "abort-deconfigure" "in-favour"
# $failed_install_package $fip_version ["removing"
# $conflicting_package $cp_version]
# The package is unpacked; all dependencies are at least Half-Installed,
# previously been configured, and not removed. In some error situations,
# dependencies may not be even fully unpacked.
#
# * postinst "triggered" "${triggers[*]}"
# For trigger-only calls, i.e. if "configure" is not called.
case $1 in
configure)
getent passwd xrdp >/dev/null 2>&1 || adduser \
--quiet --system --group --no-create-home \
--disabled-password --disabled-login \
--home /var/run/xrdp xrdp
touch /var/log/xrdp-sesman.log /var/log/xrdp.log
chown root:adm /var/log/xrdp-sesman.log
chown xrdp:adm /var/log/xrdp.log
chmod 0640 /var/log/xrdp-sesman.log /var/log/xrdp.log
if dpkg --compare-versions "$2" lt '0.4.0~dfsg-7'; then
rm -f /etc/xrdp/rsakeys.ini
fi
# Generate snakeoil RDP security keys
test -e /etc/xrdp/rsakeys.ini || (
umask 077
xrdp-keygen xrdp auto
chown xrdp /etc/xrdp/rsakeys.ini
)
# Generate/link snakeoil X509 certificate and key
test -e /etc/xrdp/cert.pem || (
make-ssl-cert generate-default-snakeoil
ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/xrdp/cert.pem
ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/xrdp/key.pem
)
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
triggered)
;;
*)
echo >&2 "postinst called with unknown subcommand '$1'"
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
# Automatically added by dh_installdeb/11.1.4ubuntu1
dpkg-maintscript-helper mv_conffile /etc/pam.d/sesman /etc/pam.d/xrdp-sesman 0.9\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/pam.d/xrdp-sesman 0.9\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0407.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0409.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-040a.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-040c.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0410.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0411.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0414.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0415.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0416.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0419.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-041d.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0807.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0809.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-080c.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0813.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-0816.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-100c.ini 0.9.1\~20161119\+gite8308d5\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-e0010411.ini 0.9.1\~2016121126\+git5171fa7\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-e0200411.ini 0.9.1\~2016121126\+git5171fa7\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xrdp/km-e0210411.ini 0.9.1\~2016121126\+git5171fa7\~ -- "$@"
# End automatically added section
# Automatically added by dh_installinit/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/xrdp" ]; then
update-rc.d xrdp defaults >/dev/null
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
invoke-rc.d xrdp $_dh_action || exit 1
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'xrdp-sesman.service' >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'xrdp-sesman.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'xrdp-sesman.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'xrdp-sesman.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'xrdp.service' >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'xrdp.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'xrdp.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'xrdp.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
deb-systemd-invoke $_dh_action 'xrdp-sesman.service' >/dev/null || true
fi
fi
# End automatically added section
exit 0
|