D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
lib
/
dpkg
/
info
/
Filename :
polkitd.postinst
back
Copy
#!/bin/sh # postinst script for polkitd # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * <postinst> `configure' <most-recently-configured-version> # * <old-postinst> `abort-upgrade' <new version> # * <conflictor's-postinst> `abort-remove' `in-favour' <package> # <new-version> # * <postinst> `abort-remove' # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' # <failed-install-package> <version> `removing' # <conflicting-package> <version> # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package reboot_required() { echo "Upgrading to this polkitd version requires a reboot, please reboot the system when convenient." >&2 # Trigger an update notification that recommends a reboot. touch /run/reboot-required || true if ! grep -Fqsx polkitd /run/reboot-required.pkgs; then echo polkitd >> /run/reboot-required.pkgs || true fi } set_perms() { USER=$1 GROUP=$2 MODE=$3 FILE=$4 if ! dpkg-statoverride --list "$FILE" > /dev/null 2>&1; then chown "$USER:$GROUP" "$FILE" chmod "$MODE" "$FILE" fi } stop_polkitd () { if [ -n "${DPKG_ROOT-}" ]; then return fi if [ -d /run/systemd/system ]; then deb-systemd-invoke stop polkit.service >/dev/null || true else # On non-systemd systems, polkitd is started as a traditional D-Bus # system service and is not managed by a service manager, so this is # the best we can do start-stop-daemon --stop --oknodo --quiet --exec /usr/lib/polkit-1/polkitd || true fi } case "$1" in configure) if ! getent passwd polkitd >/dev/null; then user_changed=yes else user_changed= fi # Intentionally not using dh_installsysusers: we need enough control # over sequencing to reload dbus-daemon after doing this, but before # restarting polkitd systemd-sysusers ${DPKG_ROOT:+--root="$DPKG_ROOT"} polkit.conf # When running with systemd (default) there's no need for SUID anymore # as the socket-activated service takes care of privilege escalation safely if ! dpkg -s systemd-sysv > /dev/null 2>&1; then set_perms root root 4755 /usr/lib/polkit-1/polkit-agent-helper-1 fi # If the polkitd user was newly created or newly added to the polkitd # group, the dbus-daemon might not know about that until reloaded. # dbus-broker's service has a dbus.service alias, so this will reload # either dbus-daemon or dbus-broker, whichever is used. if [ -z "${DPKG_ROOT-}" ] && [ -n "$user_changed" ]; then invoke-rc.d dbus reload || true fi # begin-remove-after: released:forky # If GNOME is already running when upgrading from a pre-socket activated agent # version, then the desktop might break, ask for a reboot if [ -d /run/systemd/system ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt 127~; then reboot_required fi # end-remove-after ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installxmlcatalogs/UNDECLARED if [ "$1" = "configure" ]; then update-xmlcatalog --sort --add --type public --id "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" --package polkitd --local /usr/share/xml/polkit-1/catalog.xml update-xmlcatalog --sort --add --type system --id "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd" --package polkitd --local /usr/share/xml/polkit-1/catalog.xml update-xmlcatalog --sort --add --type public --id "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" --package polkitd --root update-xmlcatalog --sort --add --type system --id "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd" --package polkitd --root fi # End automatically added section # Automatically added by dh_installtmpfiles/13.31ubuntu1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "$(command -v systemd-tmpfiles)" ]; then systemd-tmpfiles ${DPKG_ROOT:+--root="$DPKG_ROOT"} --create polkit-tmpfiles.conf || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.31ubuntu1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "$DPKG_ROOT" ] && [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then deb-systemd-invoke try-restart 'polkit.service' >/dev/null || true fi fi fi # End automatically added section # Automatically added by dh_installsystemd/13.31ubuntu1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'polkit-agent-helper.socket' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'polkit-agent-helper.socket'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'polkit-agent-helper.socket' >/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 'polkit-agent-helper.socket' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.31ubuntu1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'polkit-agent-helper.socket' >/dev/null || true fi fi # End automatically added section # If dpkg renamed a sysadmin-modified /etc/pam.d/polkit-1 to .dpkg-bak, # rename it back to the original name so PAM will still load it. # (Workaround for missing dpkg feature requested in # https://bugs.debian.org/1006655) if [ -e /etc/pam.d/polkit-1.dpkg-bak ]; then echo "Moving /etc/pam.d/polkit-1.dpkg-bak back to /etc/pam.d/polkit-1 ..." mv /etc/pam.d/polkit-1.dpkg-bak /etc/pam.d/polkit-1 fi # On non-systemd systems, polkitd is started as a traditional D-Bus # system service and is not managed by a service manager, so the # closest thing we can do to a restart operation is to terminate it # and let dbus-daemon restart it. if ! [ -d /run/systemd/system ]; then stop_polkitd fi exit 0 # vim:set sw=4 sts=4 et: