Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > d8d1204fe25c33af6f7b481ed756817f > scriptlet

pki-tks-10.0.6-1.fc18.noarch.rpm

PREUN

/bin/sh
if [ $1 = 0 ] ; then
    /bin/systemctl --no-reload disable pki-tksd.target > /dev/null 2>&1 || :
    /bin/systemctl stop pki-tksd.target > /dev/null 2>&1 || :
fi


## %preun -n pki-server
## NOTE:  At this time, NO attempt has been made to update ANY PKI subsystem
##        from EITHER 'sysVinit' OR previous 'systemd' processes to the new
##        PKI deployment process

POSTIN

/bin/sh
# Attempt to update ALL old "TKS" instances to "systemd"
if [ -d /etc/sysconfig/pki/tks ]; then
    for inst in `ls /etc/sysconfig/pki/tks`; do
        if [ ! -e "/etc/systemd/system/pki-tksd.target.wants/pki-tksd@${inst}.service" ]; then
            ln -s "/lib/systemd/system/pki-tksd@.service" \
                  "/etc/systemd/system/pki-tksd.target.wants/pki-tksd@${inst}.service"
            [ -L /var/lib/${inst}/${inst} ] && unlink /var/lib/${inst}/${inst}
            ln -s /usr/sbin/tomcat6-sysd /var/lib/${inst}/${inst}

            if [ -e /var/run/${inst}.pid ]; then
                kill -9 `cat /var/run/${inst}.pid` || :
                rm -f /var/run/${inst}.pid
                echo "pkicreate.systemd.servicename=pki-tksd@${inst}.service" >> \
                     /var/lib/${inst}/conf/CS.cfg || :
                /bin/systemctl daemon-reload >/dev/null 2>&1 || :
                /bin/systemctl restart pki-tksd@${inst}.service || :
            else 
                echo "pkicreate.systemd.servicename=pki-tksd@${inst}.service" >> \
                     /var/lib/${inst}/conf/CS.cfg || :
            fi
        else
            # Conditionally restart this Dogtag 9 instance
            /bin/systemctl condrestart pki-tksd@${inst}.service
        fi
    done
fi
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
(                                                   
if [ -d /etc/sysconfig/pki/%i ]; then                                        
  for F in `find /etc/sysconfig/pki/tks -type f`; do                          
    instance=`basename $F`                                                   
    if [ -f /etc/sysconfig/$instance ]; then                                 
        sed -i -e 's/catalina.out/tomcat-initd.log/' /etc/sysconfig/$instance 
    fi                                                                       
  done                                                                       
fi                                                                           
)

POSTUN

/bin/sh
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ "$1" -ge "1" ] ; then
    /bin/systemctl try-restart pki-tksd.target >/dev/null 2>&1 || :
fi


## %postun -n pki-server
## NOTE:  At this time, NO attempt has been made to update ANY PKI subsystem
##        from EITHER 'sysVinit' OR previous 'systemd' processes to the new
##        PKI deployment process