Sophie

Sophie

distrib > PLD > ac > amd64 > by-pkgid > c3a1225a53244f873fdd8733d4d97717 > scriptlet

hal-0.5.7.1-3.amd64.rpm

PREIN

/bin/sh

 
 
if [ -n "`/usr/bin/getgid haldaemon`" ]; then 
	if [ "`/usr/bin/getgid haldaemon`" != "126" ]; then 
		echo "Error: group haldaemon doesn't have gid=126. Correct this before installing hal." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group haldaemon GID=126." 
	/usr/sbin/groupadd -g 126 -r haldaemon 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : 
fi;
 
 
 
if [ -n "`/bin/id -u haldaemon 2>/dev/null`" ]; then 
	if [ "`/bin/id -u haldaemon`" != "126" ]; then 
		echo "Error: user haldaemon doesn't have uid=126. Correct this before installing hal." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding user haldaemon UID=126." 
	/usr/sbin/useradd \
		 \
		-u 126 \
		-r \
		-d /usr/share/empty \
		-s /bin/false \
		-c "HAL daemon"\
		-g haldaemon \
		 \
		 \
		haldaemon 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || : 
fi;

PREUN

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

POSTIN

/bin/sh
/sbin/chkconfig --add haldaemon
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/haldaemon ] && . /etc/sysconfig/haldaemon
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/haldaemon ]; then
/sbin/service haldaemon restart 1>&2 || :;
else
echo 'Run "/sbin/service haldaemon start" to start haldaemon service.'
fi
fi };