postinst is in boinc-client 7.2.42+dfsg-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 105 106 107 108 109 110 | #!/bin/sh
# postinst script for boinc-client
set -e
# Source the debconf shell library.
. /usr/share/debconf/confmodule
BOINC_DIR=/var/lib/boinc-client
CONF_DIR=/etc/boinc-client
mv_conffile()
{
if [ ! -L "$BOINC_DIR/$1" ] && [ -f "$BOINC_DIR/$1" ]; then
mv -f "$BOINC_DIR/$1" "$CONF_DIR/$1"
fi
ln -sf "$CONF_DIR/$1" "$BOINC_DIR/$1"
}
ch_stat()
{
# Don't do anything if an override exists.
if ! dpkg-statoverride --list "$3" >/dev/null 2>&1 && [ -e "$3" ]; then
chmod "$1" "$3"
chown "$2" "$3"
fi
}
case "$1" in
configure)
# Create boinc group if it doesn't already exist.
if ! getent group boinc >/dev/null; then
addgroup --quiet --system boinc
fi
# Create boinc user if it doesn't already exist.
if ! getent passwd boinc >/dev/null; then
adduser --quiet --system --ingroup boinc --home $BOINC_DIR \
--gecos "BOINC core client" boinc
fi
# Assign boinc user to group video if not already the case
if ! getent group video | grep -q boinc; then
usermod -a -G video boinc || echo "Could not assign boinc user to group 'video'."
fi
# Make sure the /var/lib/boinc-client directory exists and
# is owned by the boinc user.
mkdir $BOINC_DIR 2>/dev/null || true
chown -h boinc:boinc $BOINC_DIR 2>/dev/null || true
# Move old configuration files to /etc/boinc-client/ and
# create symlinks for the BOINC core client.
mv_conffile cc_config.xml
mv_conffile global_prefs_override.xml
mv_conffile gui_rpc_auth.cfg
mv_conffile remote_hosts.cfg
# Set reasonable permissions for boinc-client's conffiles (see #407678
# and #458007) but only if no 'stat override' exists.
# cc_config.xml should be boinc:boinc and not root:boinc in order to avoid lp bug #1162596
# users should be able to change the boinc configuration by default
ch_stat 0644 boinc:boinc "$CONF_DIR/cc_config.xml"
ch_stat 0664 root:boinc "$CONF_DIR/global_prefs_override.xml"
ch_stat 0640 root:boinc "$CONF_DIR/gui_rpc_auth.cfg"
ch_stat 0644 root:boinc "$CONF_DIR/remote_hosts.cfg"
# Make a symlink to ca-certificates certs file. BOINC's original file
# is in curl/ca-bundle.crt (which is not in our tarball, because the
# export-boinc script removes the curl dir).
CA_FILE=/etc/ssl/certs/ca-certificates.crt
CA_LINK="$BOINC_DIR/ca-bundle.crt"
if [ ! -e $CA_LINK ] && [ -f $CA_FILE ]; then
ln -sf $CA_FILE $CA_LINK
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Automatically added by dh_installinit
if [ -x "/etc/init.d/boinc-client" ] || [ -e "/etc/init/boinc-client.conf" ]; then
if [ ! -e "/etc/init/boinc-client.conf" ]; then
update-rc.d boinc-client defaults >/dev/null
fi
invoke-rc.d boinc-client start || exit $?
fi
# End automatically added section
# Automatically added by dh_installudev
if [ "$1" = configure ]; then
if [ -e "/etc/udev/rules.d/z60_boinc-client.rules" ]; then
echo "Preserving user changes to /etc/udev/rules.d/40-boinc-client.rules ..."
if [ -e "/etc/udev/rules.d/40-boinc-client.rules" ]; then
mv -f "/etc/udev/rules.d/40-boinc-client.rules" "/etc/udev/rules.d/40-boinc-client.rules.dpkg-new"
fi
mv -f "/etc/udev/rules.d/z60_boinc-client.rules" "/etc/udev/rules.d/40-boinc-client.rules"
fi
fi
# End automatically added section
exit 0
|