Home | History | Annotate | Download | only in man3ha
 te
CDDL HEADER START

The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.

You can obtain a copy of the license at CDDL.txt
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.

When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at CDDL.txt.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]

CDDL HEADER END
Copyright 2007 Sun Microsystems, Inc. All
rights reserved. Use is subject to license terms.
scds_pmf_start 3HA "24 Sep 2007" "Sun Cluster 3.2" "Sun Cluster HA and Data Services"
NAME
scds_pmf_start, scds_pmf_start_env - execute a program under PMF control
SYNOPSIS

cc [flags.\|.\|.] -I /usr/cluster/include file -L /usr/cluster/lib  -l  dsdev
#include <rgm/libdsdev.h>

scha_err_t scds_pmf_start(scds_handle_t handle, scds_pmf_type_t program_type,
 int instance, const char *command, int child_monitor_level)

scha_err_t scds_pmf_start_env(scds_handle_t handle, scds_pmf_type_t program_type,
 int instance, const char *command, int child_monitor_level, char ** env)
DESCRIPTION

The scds_pmf_start() function executes a program, specified by command, under PMF control. This function is equivalent to the pmfadm(1M) command with the -c option.

The command argument contains a command line and command line arguments that are passed to the function.

When you start a data service application or other process (program type SCDS_PMF_TYPE_SVC or SCDS_PMF_TYPE_OTHER) under PMF with scds_pmf_start(), you choose the level of child processes to monitor by using the child_monitor_level argument. Values for the child_monitor_level argument are none, some or all. The child_monitor_level argument specifies that children up to and including level child_monitor_level will be monitored. The original process is executed at level 0, its children at level 1, their children at level 2, and so on. Any new fork operation produces a new level of children. Specify -1 to monitor all levels of children.

For example, if the command to start is a daemon, the appropriate child_monitor_level is 1. If the command to start is a script that starts a daemon, the appropriate value for child_monitor_level is 2.

For a fault monitor (program type SCDS_PMF_TYPE_MON), the child_monitor_level argument is ignored and 0 is used.

If the underlying application process is already running, scds_pmf_start() prints a syslog() error and returns SCHA_ERR_INTERNAL because the RGM guarantees that two calls to a START function on a node must have an intervening STOP function.

PARAMETERS

The following parameters are supported:

.na handle .ad The handle returned from scds_initialize(3HA)

.na program_type .ad Type of program to execute. Valid types are:

.na SCDS_PMF_TYPE_SVC .ad Data service application

.na SCDS_PMF_TYPE_MON .ad Fault monitor

.na SCDS_PMF_TYPE_OTHER .ad Other

.na instance .ad For resources with multiple instances, this integer, starting at 0, uniquely identifies the instance. For single instance resources, use 0.

.na command .ad Command, including command line arguments, to execute under PMF control.

.na child_monitor_level .ad For program_type SCDS_PMF_TYPE_SVC and SCDS_PMF_TYPE_OTHER, this argument specifies the level of child processes to be monitored (equivalent to the -C option to pmfadm). Use -1 to specify all levels of child processes. For program_type SCDS_PMF_TYPE_MON, this argument is ignored.

.na env .ad Specifies an array of character pointers to environment strings, which are described in the execve(2) man page. When the program that the command parameter specifies is executed, this environment is passed to this program.

RETURN VALUES

The scds_pmf_start() function returns the following:

.na 0 .ad The function succeeded.

.na nonzero .ad The function failed.

ERRORS

.na SCHA_ERR_INTERNAL .ad The underlying application process is already running.

.na SCHA_ERR_NOERR .ad The function succeeded.

.na Other values .ad The function failed. See scha_calls(3HA) for a description of other error codes.

FILES

.na /usr/cluster/include/rgm/libdsdev.h .ad Include file

.na /usr/cluster/lib/libdsdev.so .ad Library

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWscdev
Interface StabilityEvolving
SEE ALSO

pmfadm(1M), scds_initialize(3HA), scds_pmf_stop(3HA), scds_svc_wait(3HA), scha_calls(3HA), execve(2), attributes(5)