Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 6bf75d87025598654cdbae90f814a853 > scriptlet

systemtap-server-2.2.1-1.fc18.i686.rpm

PREIN

/bin/sh
getent group stap-server >/dev/null || groupadd -g 155 -r stap-server 2>/dev/null || groupadd -r stap-server
getent passwd stap-server >/dev/null || \
  useradd -c "Systemtap Compile Server" -u 155 -g stap-server -d /var/lib/stap-server -r -s /sbin/nologin stap-server 2>/dev/null || \
  useradd -c "Systemtap Compile Server" -g stap-server -d /var/lib/stap-server -r -s /sbin/nologin stap-server

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 ~stap-server && chmod 755 ~stap-server

if [ ! -f ~stap-server/.systemtap/rc ]; then
  mkdir -p ~stap-server/.systemtap
  chown stap-server:stap-server ~stap-server/.systemtap
  echo "--rlimit-as=614400000 --rlimit-cpu=60 --rlimit-nproc=20 --rlimit-stack=1024000 --rlimit-fsize=51200000" > ~stap-server/.systemtap/rc
  chown stap-server:stap-server ~stap-server/.systemtap/rc
fi

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
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