PREIN
/bin/sh
getent group sepgsql >/dev/null || groupadd -r sepgsql
getent passwd sepgsql >/dev/null || \
useradd -r -g sepgsql -s /bin/bash -c "SE-PostgreSQL" sepgsql
exit 0
PREUN
/bin/sh
if [ $1 -eq 0 ]; then # rpm -e case
/sbin/service sepostgresql condstop >/dev/null 2>&1
/sbin/chkconfig --del sepostgresql
fi
POSTIN
/bin/sh
/sbin/chkconfig --add sepostgresql
/sbin/ldconfig
# Fix up non-standard file contexts
/sbin/fixfiles -R sepostgresql restore || :
/sbin/restorecon -R /var/lib/sepgsql || :
POSTUN
/bin/sh
/sbin/ldconfig
if [ $1 -ge 1 ]; then # rpm -U case
/sbin/service sepostgresql condrestart >/dev/null 2>&1 || :
fi
if [ $1 -eq 0 ]; then # rpm -e case
/sbin/fixfiles -R sepostgresql restore || :
test -d /var/lib/sepgsql && \
/sbin/restorecon -R /var/lib/sepgsql || :
fi