postinst is in murano-agent 1:2.0.0-1.
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 | #!/bin/sh
set -e
pkgos_adduser () {
local VAR_UG_PKG_NAME
VAR_UG_PKG_NAME=${1}
# Create user and groups if they don't exist
if ! getent group ${VAR_UG_PKG_NAME} > /dev/null 2>&1 ; then
addgroup --quiet --system ${VAR_UG_PKG_NAME}
fi
if ! getent passwd ${VAR_UG_PKG_NAME} > /dev/null 2>&1 ; then
adduser --system \
--home /var/lib/${VAR_UG_PKG_NAME} \
--no-create-home \
--quiet \
--disabled-password \
--shell /bin/bash \
--group ${VAR_UG_PKG_NAME}
fi
}
pkgos_var_user_group () {
local VAR_UG_PKG_NAME
VAR_UG_PKG_NAME=${1}
pkgos_adduser ${VAR_UG_PKG_NAME}
# Create /var/{lib,log}/<package> with that user/group if it doesn't exist
if [ ! -d /var/lib/${VAR_UG_PKG_NAME} ] ; then
mkdir -p /var/lib/${VAR_UG_PKG_NAME}/cache
fi
chown ${VAR_UG_PKG_NAME}:${VAR_UG_PKG_NAME} /var/lib/${VAR_UG_PKG_NAME}
if [ "${VAR_UG_PKG_NAME}" = "nova" ] ; then
chmod 755 /var/lib/nova
else
chmod 0750 /var/lib/${VAR_UG_PKG_NAME}
fi
if [ ! -d /var/log/${VAR_UG_PKG_NAME} ] ; then
mkdir -p /var/log/${VAR_UG_PKG_NAME}
fi
chown ${VAR_UG_PKG_NAME}:${VAR_UG_PKG_NAME} /var/log/${VAR_UG_PKG_NAME}
chmod 0750 /var/log/${VAR_UG_PKG_NAME}
}
pkgos_write_new_conf () {
local WRITE_N_CONF_PKG_NAME CONF_FNAME
WRITE_N_CONF_PKG_NAME=${1}
CONF_FNAME=${2}
SRC_PATH=/usr/share/${DPKG_MAINTSCRIPT_PACKAGE}/${CONF_FNAME}
DST_DIR=/etc/${WRITE_N_CONF_PKG_NAME}
DST_PATH=${DST_DIR}/${CONF_FNAME}
if [ ! -d ${DST_DIR} ] ; then
mkdir -p ${DST_DIR}
fi
chmod 0750 ${DST_DIR}
chown ${WRITE_N_CONF_PKG_NAME}:${WRITE_N_CONF_PKG_NAME} ${DST_DIR}
if [ ! -e ${DST_PATH} ] ; then
install -D -m 640 -o ${WRITE_N_CONF_PKG_NAME} -g ${WRITE_N_CONF_PKG_NAME} ${SRC_PATH} ${DST_PATH}
fi
}
if [ "$1" = "configure" ] ; then
pkgos_var_user_group murano-agent
pkgos_write_new_conf murano-agent muranoagent.conf
fi
# Automatically added by dhpython:
if which pycompile >/dev/null 2>&1; then
pycompile -p murano-agent
fi
# End automatically added section
# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask murano-agent.service >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled murano-agent.service; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable murano-agent.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 murano-agent.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/murano-agent" ]; then
update-rc.d murano-agent defaults >/dev/null
fi
if [ -x "/etc/init.d/murano-agent" ] || [ -e "/etc/init/murano-agent.conf" ]; then
invoke-rc.d murano-agent start || true
fi
fi
# End automatically added section
exit 0
|