From 47e6e7c84f008a53061e661f31ae96629bc694ef Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 26 Oct 2014 12:33:50 +0400 Subject: Debian 3.9.10 --- build/sun/preremove | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 build/sun/preremove (limited to 'build/sun/preremove') diff --git a/build/sun/preremove b/build/sun/preremove new file mode 100755 index 0000000..221ce4c --- /dev/null +++ b/build/sun/preremove @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Stop PCP related services before removing the package +# + +export PATH=/usr/sbin:$PATH + +svcs -H svc:/application/pcp/\* \ +| while read state ts svc; do + if [ "$state" = "online" ] ; then + svcadm -v disable -s $svc + fi + svccfg delete -f $svc +done + +if [ -f /etc/pcp.conf ] +then + # for all the configuration files we know about, the goal is it + # have files with a .pre suffix unless we're certain they have + # not been locally altered + # + . /etc/pcp.conf + for conf in \ + $PCP_PMCDCONF_PATH $PCP_PMCDOPTIONS_PATH $PCP_PMCDRCLOCAL_PATH \ + $PCP_PMIECONTROL_PATH $PCP_PMLOGGERCONTROL_PATH \ + $PCP_PMPROXYOPTIONS_PATH $PCP_PMWEBDOPTIONS_PATH + do + if [ -f $conf.orig -a -f $conf ] + then + if cmp -s $conf.orig $conf + then + # file not changed since installation + rm $conf.orig + else + cp $conf $conf.pre + rm $conf.orig + fi + elif [ -f $conf ] + then + cp $conf $conf.pre + fi + done +fi -- cgit v1.2.3