postinst is in puppet 5.4.0-2ubuntu3.
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 | #!/bin/sh
set -e
if [ "$1" = "configure" ]; then
# Create the "puppet" user
if ! getent passwd puppet > /dev/null; then
adduser --quiet --system --group --home /var/lib/puppet \
--no-create-home \
--gecos "Puppet configuration management daemon" \
puppet
fi
# Create the "puppet" group, if it is missing, and set the
# primary group of the "puppet" user to this group.
if ! getent group puppet > /dev/null; then
addgroup --quiet --system puppet
usermod -g puppet puppet
fi
# Set correct permissions and ownership for puppet directories
if ! dpkg-statoverride --list /var/log/puppet >/dev/null 2>&1; then
dpkg-statoverride --update --add puppet puppet 0750 /var/log/puppet
fi
# Create folders common to "puppet" and "puppetmaster", which need
# to be owned by the "puppet" user
if ! dpkg-statoverride --list /var/lib/puppet >/dev/null 2>&1; then
dpkg-statoverride --update --add puppet puppet 0750 /var/lib/puppet
fi
if ! dpkg-statoverride --list /var/cache/puppet/state >/dev/null 2>&1; then
dpkg-statoverride --update --add puppet puppet 0750 /var/cache/puppet/state
fi
if [ -n "$2" ] && dpkg --compare-versions "$2" gt "4.4.2-1~" && \
dpkg --compare-versions "$2" lt "4.8.1-3~"; then
# Between 4.4.2-1 and 4.8.1-3, puppet was called 'puppet-agent'
# Preserve the systemd and SysV service states
if deb-systemd-helper debian-installed puppet-agent.service; then
# dh_systemd_enable will not enable the service by
# default as of 4.8.2-2; enable it if puppet-agent was
# enabled.
deb-systemd-helper unmask puppet.service >/dev/null || true
if deb-systemd-helper --quiet was-enabled puppet-agent.service; then
deb-systemd-helper enable puppet.service >/dev/null || true
else
deb-systemd-helper update-state puppet.service >/dev/null || true
fi
fi
if [ -x /etc/init.d/puppet-agent ] && \
! ls /etc/rc[S2345].d/S[0-9][0-9]puppet-agent >/dev/null 2>&1; then
update-rc.d puppet defaults-disabled >/dev/null || true
fi
# Remove puppet-agent's symlinks to avoid duplicate starts
# under SysV
update-rc.d -f puppet-agent remove >/dev/null || true
elif [ -n "$2" ] && dpkg --compare-versions "$2" lt "4.4.2-1~"; then
# The 4.x series has a different lock path. Mirror the old
# agent lock to the new path to preserve the lock state.
# Note that we could disable the service here instead, but
# there is always the case $old_lock was not used because of
# local configuration (in which case $new_lock will probably
# not be consulted as well).
old_lock="/var/lib/puppet/state/agent_disabled.lock"
new_lock="/var/cache/puppet/state/agent_disabled.lock"
if [ -f "$old_lock" ]; then
cp "$old_lock" "$new_lock"
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/puppet.conf >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/puppet" ]; then
update-rc.d puppet defaults-disabled >/dev/null
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
invoke-rc.d puppet $_dh_action || exit 1
fi
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 deb-systemd-helper debian-installed 'puppet.service'; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'puppet.service' >/dev/null || true
if deb-systemd-helper --quiet was-enabled 'puppet.service'; then
# Create new symlinks, if any.
deb-systemd-helper enable 'puppet.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 'puppet.service' >/dev/null || true
fi
# End automatically added section
|