Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 38fa41eb562a244dbe0e789e8078c804 > scriptlet

systemtap-server-1.3-2.fc14.i686.rpm

PREIN

/bin/sh
getent passwd stap-server >/dev/null || \
  useradd -c "Systemtap Compile Server" -u 155 -g stap-server -d /var/lib/stap-server -m -r -s /sbin/nologin stap-server || \
  useradd -c "Systemtap Compile Server" -g stap-server -d /var/lib/stap-server -m -r -s /sbin/nologin stap-server
test -e ~stap-server && chmod 755 ~stap-server
exit 0

PREUN

/bin/sh
# Check that this is the actual deinstallation of the package, as opposed to
# just removing the old package on upgrade.
if [ $1 = 0 ] ; then
    /sbin/service stap-server stop >/dev/null 2>&1
    /sbin/chkconfig --del stap-server
fi
exit 0

POSTIN

/bin/sh
test -e /var/log/stap-server/log || {
     touch /var/log/stap-server/log
     chmod 664 /var/log/stap-server/log
     chown stap-server:stap-server /var/log/stap-server/log
}
# If it does not already exist, as stap-server, generate the certificate
# used for signing and for ssl.
if test ! -e ~stap-server/.systemtap/ssl/server/stap.cert; then
   runuser -s /bin/sh - stap-server -c /usr/libexec/systemtap/stap-gen-cert >/dev/null
   # Authorize the certificate as a trusted ssl peer and as a trusted signer
   # on the local host.
   /usr/bin/stap-authorize-server-cert ~stap-server/.systemtap/ssl/server/stap.cert
   /usr/bin/stap-authorize-signing-cert ~stap-server/.systemtap/ssl/server/stap.cert
fi

# Activate the service
/sbin/chkconfig --add stap-server
exit 0

POSTUN

/bin/sh
# Check whether this is an upgrade of the package.
# If so, restart the service if it's running
if [ "$1" -ge "1" ] ; then
    /sbin/service stap-server condrestart >/dev/null 2>&1 || :
fi
exit 0