===== Resources ===== This chapter describes all possible resource entries. All packages defined in the packages.conf must have a matching resource (package name = resource name). But not every resource must be a package, a resource can be used by other resources (as sub-resources). You can e.g. group resources as one resource and use that in several package resources. The resource definition is processed from left to right when the resource is started, from right to left when the resource is stopped. === CPKG === A specific cluster packages must be active in the cluster to continue to process the resource definition. {| ! definition | ''CPKG:[:WAIT[:]'' |- ! action when "start" | Only if the cluster package is started on any node in the cluster then this package is started. If WAIT is specified, this package waits for a default time of or 5 minutes. |- ! action when "stop" | none |- ! examples | ''CPKG:database:WAIT'' |} {| ! definition | ''CPKG:[:START]'' |- ! action when "start" | If the cluster package is not active on any node in the cluster then the is started on the first cluster node defined for in the PACKAGES file. |- ! action when "stop" | none |- ! examples | ''CPKG:appserver:START'' |} {| ! definition | ''CPKG:[:WAITSTART[:]'' |- ! action when "start" | If the cluster package is not active on any node in the cluster then wait for or 5 minutes. if it is still not active after that delay, start on the first cluster node defined for it in the PACKAGES file. |- ! action when "stop" | none |- ! examples | ''CPKG:appserver:WAITSTART:10'' |} === !CPKG === To start this resource, a specific package must not be active in the cluster. {| ! definition | ''!CPKG:[:STOP]'' |- ! action when "start" | If package is active on any cluster node, then this package is not started. If STOP is specified, the is stopped and this package is started (the processing of the resource definition is continued). |- ! action when "stop" | none |- ! example | ''!CPKG:disturber:STOP'' |} === FS === Mount a file system. {| ! definition | ''FS:[:FSCK]'' |- ! action when "start" | The file system is mounted (mount). It only can be mounted on one cluster node at a time. The must be present in the /etc/fstab. The optional FSCK will perform a file system check before mounting it. |- ! action when "stop" | The file system is unmounted (umount). |- ! examples | ''FS:/u01/data'' |} === FSG === Mount a file system group. This resource type is rarely used as it needs a file system group definition based on specific remarks in the ''/etc/fstab'' file. {| ! definition | ''FSG:[:FSCK]'' |- ! action when "start" | All file systems belonging to the are mounted (mount). They only can be mounted on one cluster node at a time. The must be defined in the /etc/fstab. The optional FSCK will perform a file system check before mounting any file system. |- ! action when "stop" | All file systems of the are unmounted (umount). |- ! example | ''FSG:allsan'' |} === IP === ip address {| ! definition | ''IP:{|AUTO}::[:ROUTE]'' |- ! action when "start" | startup an ip address on the given or if ''AUTO'' is set, find depending on the ip-address and netmask a matching interface. |- ! action when "stop" | The optional ROUTE is removed and the ip-address is removed from the used interface. |- ! examples | ''IP:eth0:10.1.17.103:255.255.255.0'', ''IP:AUTO:10.1.12.122:255.255.255.0'' |} === NFS === Mount an NFS file system. {| ! definition | ''NFS:'' |- ! action when "start" | The NFS file system is mounted (mount). It can be mounted on more than one cluster node at a time. The must be present in the /etc/fstab. |- ! action when "stop" | The NFS file system is unmounted (umount). |- ! example | ''NFS:/backup/central'' |} === NFSG === Mount a group of NFS file systems. This resource type is rarely used as it needs a file system group definition based on specific remarks in the ''/etc/fstab'' file. {| ! definition | ''NFSG:'' |- ! action when "start" | All NFS file systems of the file system group are mounted (mount). They can be mounted on more than one cluster node at a time. The must be defined in the /etc/fstab. |- ! action when "stop" | All NFS file system of the are unmounted (umount). |- ! example | ''NFSG:allsapfs'' |} === PKG === To start this package, another specific package must be active on **the current** cluster node. {| ! definition | ''PKG:[:WAIT[:]]'' |- ! action when "start" | Start the package only if the is active on the current cluster node. If WAIT is specified, wait for or 5 minutes for the to become active. |- ! action when "stop" | none |- ! example | ''PKG:apache2'', ''PKG:apache2:WAIT:3'' |} === !PKG === Another package must not be active on the same cluster node. {| ! definition | ''!PKG:[:{STOP|SWITCH}]'' |- ! action when "start" | The must not be active on this cluster node. If STOP or SWITCH is given, stop the on this cluster node. |- ! action when "stop" | If SWITCH is given, restart the . |- ! example | ''!PKG:disturber:STOP'', ''!PKG:alternative:SWITCH'' |} === PRG === Execute a script to start or stop the package. {| ! definition | ''PRG[:]'' |- ! action when "start" | By default, when no is given, the script ''/etc/sccl/scripts/_startstop'' is executed. If a is given, then that script is executed. If the only contains a base file name (no slashes), the script ''/etc/sccl/scripts/'' is executed. All scripts are executed with parameter "start". |- ! action when "stop" | The appropriate script is executed with parameter "stop". |- ! examples | ''PRG'', ''PRG:/u01/scripts/kerberos.sh'', ''PRG:webserver.sh'' |} === PROC == Start this resource only, if a specific process is running. {| ! definition | ''PROC:[:WAIT]'' |- ! action when "start" | It is checked, whether one or more specific processes are running. The used command is ''ps -efa | grep ''. |- ! action when "stop" | none |- ! example | ''PROC:java:WAIT'' |} === !PROC == Start this resource only if specific processes are not running. {| ! definition | ''!PROC:'' |- ! action when "start" | It is checked, whether one or more certain processes are **not** running. The used command is ''ps -efa | grep ''. |- ! action when "stop" | none |- ! example | ''!PROC:backup'' |} === RAW === A raw partition. {| ! definition | ''RAW:'' |- ! action when "start" | The unlocked RAW-partition is marked locked within the cluster. |- ! action when "stop" | The locked RAW-partition is marked unlocked within the cluster. |- ! examples | ''RAW:/dev/raw1'' |} === RO === Create a routing entry. {| ! definition | ''RO::[:]'' |- ! action when "start" | A routing entry into the local net is created with net mask to the . The optional is used to derive the correct network interface. If not set, the physical interface eth0 is used. |- ! action when "stop" | The routing entry is removed. |- ! example | ''RO:10.1.11.222:255.255.255.0:10.1.11.200'' |} === RS === The resource will be started when needed by the first package and it is stopped when the last package, that the resource is used by, is stopped. {| ! definition | ''RS:'' |- ! action when "start" | The resource definition is processed (left to right/forward). |- ! action when "stop" | The resource definition is processed (right to left/backwards). |- ! example | ''RS:kerberos'' |} === RST === Stop and start other packages in the cluster. {| ! definition | ''RST:[,]...[:CLUSTER]'' |- ! action when "start" | Start or restart the on the current cluster node. If CLUSTER is given start or restart the on all cluster nodes. |- ! action when "stop" | Stop the |- ! example | ''...PRG:db_startstop SETSTATE RST:appserver:CLUSTER'' |} SETSTATE is needed to indicate that the current package is active, although the following resources are not yet processed. That prevents a deadlock situation that the other_package waits indefinetely for the current package to become active. :TODO: needs verification === !SCPKG === Stop another package in the cluster. {| ! definition | ''!SCPKG:[:WAIT|STOP]'' |- ! action when "start" | none |- ! action when "stop" | |- ! example | '' '' |} === SETSTATE === :TODO: needs functional test if still necessary. {| ! definition | ''SETSTATE'' |- ! action when "start" | Set the state of the current package to active, following RST entries can then be processed correctly. |- ! action when "stop" | none |- ! example | ''SETSTATE'' |} === SPKG === Start a sub-package. {| ! definition | ''SPKG::'' |- ! action when "start" | Start the on . |- ! action when "stop" | none |- ! example | ''SPKG:apache:webhost1'' |} === !SRES === The must not be active (only for action=stop). {| ! definition | ''!SRES:[:STOP|WAIT]'' |- ! action when "start" | none |- ! action when "stop" | If STOP is given the is stopped. If WAIT is given the further stop actions are suspended until the has been stoppen (through other actions). |- ! example | ''!SRES:stunnel:STOP'' |} === STST === :TODO: needs translation Like TST. {| ! definition | ''STST::[:]'' |- ! action when "start" | Starts up the test script (see TST for description), restarts the resource on **this** node, if returns an error. defines the maximum number of restarts of the resource. |- ! action when "stop" | The test script is stopped. |- ! example | '' '' |} === TST === Start a script on the next node (as defined in the packages.conf, if present). On the next node, the script does cyclic functional tests, if an error value is returned, the next node stops that package (best effort) on the current node and starts the package on the next node. The next node becomes the current node and again a test script is started on the next node (as defined in the packages.conf, if present). The chain ends if no more nodes are left over. There is no wrap around. The script is executed every seconds. The default for is: _test {| ! definition | ''TST:[:]'' |- ! action when "start" | The test script is started on the next node. |- ! action when "stop" | The test script is stopped. |- ! example | ''TST:60:/usr/local/sccl/test_apache'' |} === VG === Activate a volume group. (HP-UX only) {| ! definition | ''VG:'' |- ! action when "start" | Volume group is activated. |- ! action when "stop" | Volume group is deactivated. |- ! example | ''VG:vgdatabase'' |}