diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
commit | 47e6e7c84f008a53061e661f31ae96629bc694ef (patch) | |
tree | 648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /src/pmcd/rc_pcp | |
download | pcp-debian.tar.gz |
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'src/pmcd/rc_pcp')
-rw-r--r-- | src/pmcd/rc_pcp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/pmcd/rc_pcp b/src/pmcd/rc_pcp new file mode 100644 index 0000000..974ca06 --- /dev/null +++ b/src/pmcd/rc_pcp @@ -0,0 +1,76 @@ +#!/bin/sh +# +# Copyright (c) 2011 Ken McDonell. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Legacy wrapper for the Performance Co-Pilot Daemon(s) Start / Stop scripts +# +# This script is NOT part of the "rc" framework ... the "pmcd" and "pmlogger" +# scripts ARE part of the "rc" framework. This script is provided as a +# legacy bridge for any scripts or procedures that used $PCP_RC_DIR/pcp +# from the days before PCP 3.6. +# +# The following is for chkconfig on RedHat based systems +# chkconfig: +# description: Legacy init script wrapper for the Performance Co-Pilot (PCP) daemons +# +# The following is for insserv(1) based systems, +# e.g. SuSE, where chkconfig is a perl script. +### BEGIN INIT INFO +# Provides: pcp +# Required-Start: +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: +# Default-Stop: +# Short-Description: Legacy control for PCP daemons +# Description: Legacy init script wrapper for the Performance Co-Pilot (PCP) daemons +### END INIT INFO + +. $PCP_DIR/etc/pcp.env + +tmp=`mktemp -d /var/tmp/pcp.XXXXXXXXX` || exit 1 +status=0 +trap "rm -rf $tmp; exit \$status" 0 1 2 3 15 +prog=$PCP_RC_DIR/pcp + +_usage() +{ + echo "Usage: $pmprog [-v] {start|restart|condrestart|stop|status|reload|force-reload}" +} + +case "$1" in + + 'start'|'restart'|'condrestart'|'reload'|'force-reload') + $PCP_RC_DIR/pmcd $* + $PCP_RC_DIR/pmlogger $* + ;; + + 'stop') + $PCP_RC_DIR/pmlogger $* + $PCP_RC_DIR/pmcd $* + ;; + + 'status') + $PCP_RC_DIR/pmcd $* || status=$? + $PCP_RC_DIR/pmlogger $* || status=$? + ;; + + *) + _usage + ;; +esac |