docs: describe the pmdaroot process interfaces
[pcp.git] / src / pmcd / rc-proc.sh.minimal
blob42e5b8093ce707cfa52d249ab809882f76a5b412
2 # Common sh(1) procedures to be used in PCP rc scripts
4 # Minimalist version - use this if your system's init script regime
5 # does not follow the "chkconfig + runlevel" model.
7 # Copyright (c) 2000,2003 Silicon Graphics, Inc.  All Rights Reserved.
8
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 2 of the License, or (at your
12 # option) any later version.
13
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 # for more details.
18
19 # You should have received a copy of the GNU General Public License along
20 # with this program; if not, write to the Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
24 # source the PCP configuration environment variables
25 . $PCP_DIR/etc/pcp.env
27 # These functions use chkconfig if available, else tolerate missing chkconfig
28 # command (as on SUSE) by manipulating symlinks in /etc/rc.d directly.
30 # Usage:
32 # is_chkconfig_on : return 0 if $1 is chkconfig "on" else 1
33 # chkconfig_on    : chkconfig $1 "on"
34 # chkconfig_off   : chkconfig $1 "off"
35 # chkconfig_on_msg: echo a message about how to chkconfig $1 on
39 # Return 0 if $1 is chkconfig "on" (enabled) at the current run level
40 # Handles missing chkconfig command and other assorted atrocities.
42 is_chkconfig_on()
44     return 0
48 # chkconfig "on" $1
49 # Handles missing chkconfig command.
50 # (this is used by the pcp rpm %post script)
52 chkconfig_on()
54     :
58 # chkconfig "off" $1
59 # Handles missing chkconfig command.
60 # (this is used by the pcp rpm %preun script)
62 chkconfig_off()
64     :
68 # Echo a message about how to chkconfig $1 "on"
69 # Tolerates missing chkconfig command
71 chkconfig_on_msg()
73     :