File: dbus.postinst

package info (click to toggle)
dbus 1.0.2-1%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,120 kB
  • ctags: 4,346
  • sloc: ansic: 65,805; sh: 8,901; xml: 6,705; makefile: 515
file content (36 lines) | stat: -rw-r--r-- 1,247 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# -*- coding: utf-8 -*-
# Post-installation script for D-BUS
# Copyright © 2003 Colin Walters <walters@debian.org>
# Copyright © 2006 Sjoerd Simons <sjoerd@debian.org>

set -e

MESSAGEUSER=messagebus
MESSAGEHOME=/var/run/dbus


chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup --system "$MESSAGEUSER"
chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || \
	adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"

# Do not restart dbus on upgrades, only on fresh installations
# But do reload it so the machine-id can be generated
if [ "$1" = "configure" ]; then
    if [ -e /var/run/dbus/pid ] && 
      ps --no-heading -p $(cat /var/run/dbus/pid) > /dev/null; then
        # trigger an update notification which recommends to reboot
        [ -x /usr/share/update-notifier/notify-reboot-required ] && \
            /usr/share/update-notifier/notify-reboot-required || true
        if [ -x "/etc/init.d/dbus" ]; then
          if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
                invoke-rc.d dbus reload || true
          else
                /etc/init.d/dbus reload || true
          fi
        fi
        exit 0
    fi
fi

#DEBHELPER#