postinst is in dpm-name-server-mysql 1.8.7-3.
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 | #!/bin/sh
set -e
updatedpns () {
[ -r /etc/default/dpnsdaemon ] && . /etc/default/dpnsdaemon
[ -z "$NSCONFIGFILE" ] && NSCONFIGFILE=/etc/DPNSCONFIG
[ -r $NSCONFIGFILE ] || return 0
nscfg=$(cat $NSCONFIGFILE)
cfg1=$(echo $nscfg | cut -f1 -d@)
cfg2=$(echo $nscfg | cut -f2 -d@ -s)
user=$(echo $cfg1 | cut -f1 -d/)
passwd=$(echo $cfg1 | cut -f2 -d/ -s)
host=$(echo $cfg2 | cut -f1 -d/)
db=$(echo $cfg2 | cut -f2 -d/ -s)
[ -z "$user" ] && return 0
[ -z "$passwd" ] && return 0
[ -z "$host" ] && return 0
[ -z "$db" ] && db=cns_db
mycfg=$(mktemp)
cat > $mycfg <<-EOF
[client]
user=$user
password=$passwd
EOF
mysql="mysql --defaults-file=$mycfg --skip-column-names $db"
vmajor=$($mysql -e "select major from schema_version" 2>/dev/null)
vminor=$($mysql -e "select minor from schema_version" 2>/dev/null)
vpatch=$($mysql -e "select patch from schema_version" 2>/dev/null)
if [ -z "$vmajor" -o -z "$vminor" -o -z "$vpatch" ] ; then
rm $mycfg
return 0
fi
if [ $vmajor -eq 3 -a $vminor -eq 0 -a $vpatch -eq 0 ] ; then
$mysql <<-EOF
ALTER TABLE Cns_groupinfo ADD banned INTEGER;
ALTER TABLE Cns_userinfo ADD user_ca VARCHAR(255) BINARY;
ALTER TABLE Cns_userinfo ADD banned INTEGER;
CREATE INDEX linkname_idx ON Cns_symlinks(linkname(255));
UPDATE schema_version SET major = 3, minor = 1, patch = 0;
EOF
fi
rm $mycfg
return 0
}
getent group dpmmgr > /dev/null || \
addgroup --quiet --system dpmmgr
getent passwd dpmmgr > /dev/null || \
adduser --quiet --system --home /var/lib/dpm --shell /bin/sh \
--ingroup dpmmgr --disabled-password --disabled-login \
--gecos "DPM manager" dpmmgr
chown dpmmgr:dpmmgr /var/log/dpns
updatedpns
update-alternatives --install /usr/sbin/dpnsdaemon dpnsdaemon \
/usr/lib/dpm-mysql/dpnsdaemon 20 \
--slave /usr/share/man/man8/dpnsdaemon.8.gz dpnsdaemon.8.gz \
/usr/lib/dpm-mysql/dpnsdaemon.8.gz \
--slave /usr/share/lcgdm/DPNSCONFIG.templ DPNSCONFIG.templ \
/usr/lib/dpm-mysql/DPNSCONFIG.templ \
--slave /etc/init.d/dpnsdaemon dpnsdaemon.init \
/etc/dpm-mysql/dpnsdaemon.init \
--slave /etc/default/dpnsdaemon dpnsdaemon.conf \
/etc/dpm-mysql/dpnsdaemon.conf \
--slave /etc/logrotate.d/dpnsdaemon dpnsdaemon.logrotate \
/etc/dpm-mysql/dpnsdaemon.logrotate \
--slave /usr/sbin/dpns-shutdown dpns-shutdown \
/usr/lib/dpm-mysql/dpns-shutdown \
--slave /usr/share/man/man8/dpns-shutdown.8.gz dpns-shutdown.8.gz \
/usr/lib/dpm-mysql/dpns-shutdown.8.gz
if [ -x "/etc/init.d/dpnsdaemon" ]; then
update-rc.d dpnsdaemon defaults >/dev/null
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d dpnsdaemon start || exit $?
else
/etc/init.d/dpnsdaemon start || exit $?
fi
fi
|