postinst is in prelude-manager 4.1.1-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 | #!/bin/sh
set -e
add_sysuser()
{
if ! getent passwd prelude >/dev/null; then
adduser --system --disabled-login --no-create-home --home /var/run/prelude-manager/ --group prelude 2>&1 > /dev/null
fi
}
add_sysuser
if [ "$1" = "configure" ]; then
confpath="/etc/prelude-manager"
conffile="${confpath}/prelude-manager.conf"
confnew="${conffile}-new"
pkgpath="/usr/share/prelude-manager"
. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/postinst
dbc_first_version="0.9.8-3"
dbc_go prelude-manager $@
if [ ! -e $conffile ]; then
cp ${pkgpath}/prelude-manager.conf $conffile
fi
cp $conffile $confnew
if [ -z "$dbc_dbserver" ]; then
dbc_dbserver=localhost
fi
if [ -z "$dbc_dbport" ]; then
if [ "$dbc_dbtype" = "mysql" ]; then
dbc_dbport=3306
else
if [ "$dbc_dbtype" = "pgsql" ]; then
dbc_dbport=5432
fi
fi
fi
if [ -n "$dbc_dbtype" ]; then
sed -i -e "s/@DBC_TYPE@/$dbc_dbtype/" \
-e "s/@DBC_HOST@/$dbc_dbserver/" \
-e "s/@DBC_PORT@/$dbc_dbport/" \
-e "s/@DBC_NAME@/$dbc_dbname/" \
-e "s/@DBC_USER@/$dbc_dbuser/" \
-e "s/@DBC_PASS@/$dbc_dbpass/" \
$confnew
# Installing the config
if diff -q /usr/share/doc/prelude-manager/examples/prelude-manager.conf $conffile >/dev/null 2>&1; then
# configure file has not been changed .. overwrite it
cp $confnew $conffile
else
ucf --three-way --debconf-ok $confnew $conffile
fi
fi
# make sure conf file has the correct permissions and owner/group
chmod 640 /etc/prelude-manager/prelude-manager.conf
chown prelude /etc/prelude-manager/prelude-manager.conf
rm -f $confnew
db_stop
# run this command before starting initscripts
if [ -d "/var/spool/prelude-manager" ]; then
chown prelude:prelude /var/spool/prelude-manager
if [ -d "/var/spool/prelude-manager/failover" ]; then
chown prelude:prelude /var/spool/prelude-manager/failover
if [ "$(ls -A /var/spool/prelude-manager/failover)" ]; then
chown prelude:prelude /var/spool/prelude-manager/failover/*
fi
fi
if [ -d "/var/spool/prelude-manager/scheduler" ]; then
chown prelude:prelude /var/spool/prelude-manager/scheduler
if [ "$(ls -A /var/spool/prelude-manager/scheduler)" ]; then
chown prelude:prelude /var/spool/prelude-manager/scheduler/*
fi
fi
fi
PROFILE_NAME="prelude-manager"
if [ -x "/usr/bin/prelude-admin" ]; then
if [ ! -d "/etc/prelude/profile/$PROFILE_NAME" ]; then
prelude-admin add prelude-manager --uid prelude --gid prelude
prelude-admin chown prelude-manager --uid prelude --gid prelude
fi
fi
fi
# Automatically added by dh_installsystemd/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
systemd-tmpfiles --create /usr/lib/tmpfiles.d/prelude-manager.conf >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init.d/prelude-manager 3.1.0-0.2\~ prelude-manager -- "$@"
dpkg-maintscript-helper rm_conffile /etc/default/prelude-manager 3.1.0-0.2\~ prelude-manager -- "$@"
# End automatically added section
# Automatically added by dh_installsystemd/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if deb-systemd-helper debian-installed 'prelude-manager.service'; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'prelude-manager.service' >/dev/null || true
if deb-systemd-helper --quiet was-enabled 'prelude-manager.service'; then
# Create new symlinks, if any.
deb-systemd-helper enable 'prelude-manager.service' >/dev/null || true
fi
fi
# 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 'prelude-manager.service' >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/11.1.6ubuntu1
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
deb-systemd-invoke try-restart 'prelude-manager.service' >/dev/null || true
fi
fi
fi
# End automatically added section
exit 0
|