CentOS
rpm scriptlet
[root@controller keystone]# rpm -q --scripts openstack-keystone-15.0.1-1.el7.noarch
preinstall scriptlet (using /bin/sh):
# 163:163 for keystone (openstack-keystone) - rhbz#752842
getent group keystone >/dev/null || groupadd -r --gid 163 keystone
getent passwd keystone >/dev/null || \
useradd --uid 163 -r -g keystone -d /var/lib/keystone -s /sbin/nologin \
-c "OpenStack Keystone Daemons" keystone
exit 0
postinstall scriptlet (using /bin/sh):
/usr/lib/systemd/systemd-sysctl openstack-keystone.conf >/dev/null 2>&1 || :
# Install keystone.log file before, so both keystone & root users can write in it.
touch /var/log/keystone/keystone.log
chown root:keystone /var/log/keystone/keystone.log
chmod 660 /var/log/keystone/keystone.log
Ubuntu
find the deb postinst under below folder
/var/lib/dpkg/info
deb包的介绍
control 用了记录软件标识,版本号,平台,依赖信息等数据
preinst 在解包data.tar.gz前运行的脚本
postinst 在解包数据后运行的脚本
prerm 卸载时,在删除文件之前运行的脚本
postrm 在删除文件之后运行的脚本