Sophie

Sophie

distrib > PLD > th > x86_64 > by-pkgid > 390a3a482e33ef7e82745c8db4178706 > scriptlet

dbus-1.14.8-1.x86_64.rpm

PREIN

/bin/sh

 
 
if /usr/bin/getgid messagebus > /dev/null 2>&1; then 
	if [ "`/usr/bin/getgid messagebus`" != "122" ]; then 
		echo "Error: group messagebus doesn't have gid=122. Correct this before installing dbus." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group messagebus GID=122." 
	/usr/sbin/groupadd -g 122 -r messagebus 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : 
fi;

 
 
 
if [ -n "`/bin/id -u messagebus 2>/dev/null`" ]; then 
	if [ "`/bin/id -u messagebus`" != "122" ]; then 
		echo "Error: user messagebus doesn't have uid=122. Correct this before installing dbus." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding user messagebus UID=122." 
	/usr/sbin/useradd \
		 \
		-u 122 \
		-r \
		-d /usr/share/empty \
		-s /bin/false \
		-c "System message bus"\
		-g 122 \
		 \
		 \
		messagebus 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || : 
fi;

PREUN

/bin/sh
if [ "$1" = "0" ];then
	{
if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
if [ -f /var/lock/subsys/messagebus ]; then
/sbin/service messagebus stop 1>&2 || :;
fi
fi };
	/sbin/chkconfig --del messagebus
fi

 
if [ $1 -eq 0 ] && [ -x "/lib/systemd/systemd-update-helper" ]; then 
    # Package removal, not upgrade 
    /lib/systemd/systemd-update-helper remove-user-units dbus.service dbus.socket || : 
fi

POSTIN

/bin/sh
/sbin/chkconfig --add messagebus
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/messagebus ] && . /etc/sysconfig/messagebus
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
if [ -f /var/lock/subsys/messagebus ]; then
:
else
echo 'Run "/sbin/service messagebus start" to start D-Bus daemon.'
fi
fi
else
if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
if [ -f /var/lock/subsys/messagebus ]; then
echo 'Run "/sbin/service messagebus restart" to restart D-Bus daemon.'
fi
else	NORESTART=1	# for %%systemd_post if called after
fi
fi };
export NORESTART="yes"

 
if [ $1 -eq 1 ] && [ -x "/lib/systemd/systemd-update-helper" ]; then 
    # Initial installation 
    /lib/systemd/systemd-update-helper install-system-units messagebus.service || : 
fi 


 
if [ $1 -eq 1 ] && [ -x "/lib/systemd/systemd-update-helper" ]; then 
    # Initial installation 
    /lib/systemd/systemd-update-helper install-user-units dbus.service dbus.socket || : 
fi

POSTUN

/bin/sh
if [ "$1" = "0" ]; then
	/usr/lib/rpm/user_group.sh user del messagebus
	/usr/lib/rpm/user_group.sh group del messagebus
fi

	[ -x "/lib/systemd/systemd-update-helper" ] && 
		/lib/systemd/systemd-update-helper system-reload || :

Triggers

dbus < 1.4.16-5

/bin/sh
 
if [ $1 -eq 1 ] && [ -x "/lib/systemd/systemd-update-helper" ]; then 
    # Initial installation 
    /lib/systemd/systemd-update-helper install-system-units messagebus.service || : 
fi 

if [ -f /etc/sysconfig/dbus ]; then
	mv -f /etc/sysconfig/messagebus{,.rpmnew}
	mv -f /etc/sysconfig/{dbus,messagebus}
elif [ -f /etc/sysconfig/dbus.rpmsave ]; then
	mv -f /etc/sysconfig/messagebus{,.rpmnew}
	mv -f /etc/sysconfig/{dbus.rpmsave,messagebus}
fi