Sophie

Sophie

distrib > Fedora > 18 > x86_64 > media > updates > by-pkgid > dca9d8989e1d7b4e4d8d3fb74d9bd9f9 > scriptlet

postgresql-server-9.2.5-1.fc18.x86_64.rpm

PREIN

/bin/sh
/usr/sbin/groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
/usr/sbin/useradd -M -N -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
	-c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :

PREUN

/bin/sh

if [ $1 -eq 0 ] ; then 
        # Package removal, not upgrade 
        /usr/bin/systemctl --no-reload disable postgresql.service > /dev/null 2>&1 || : 
        /usr/bin/systemctl stop postgresql.service > /dev/null 2>&1 || : 
fi

POSTIN

/bin/sh

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        /usr/bin/systemctl preset postgresql.service >/dev/null 2>&1 || : 
fi 

# Run this when upgrading from SysV initscript to native systemd unit

POSTUN

/bin/sh

/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : 
if [ $1 -ge 1 ] ; then 
        # Package upgrade, not uninstall 
        /usr/bin/systemctl try-restart postgresql.service >/dev/null 2>&1 || : 
fi 

# FILES section.

Triggers

postgresql-server < 0:9.0.99

/bin/sh
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply postgresql
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save postgresql >/dev/null 2>&1 || :

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del postgresql >/dev/null 2>&1 || :
/bin/systemctl try-restart postgresql.service >/dev/null 2>&1 || :