Home | History | Annotate | Download | only in man1m
 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 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
hatimerun 1M "10 Apr 2006" "Sun Cluster 3.2" "System Administration Commands"
NAME
hatimerun - run child program under a timeout
SYNOPSIS

/usr/cluster/bin/hatimerun -t timeOutSecs [-av] [-e exitcode]
prog args

/usr/cluster/bin/hatimerun -t timeOutSecs [-v] [-e exitcode]
[-k signalname] prog args
DESCRIPTION

The hatimerun utility provides a convenient facility for timing out the execution of another child, program. It is useful when programming in scripting languages, such as the Bourne shell. See sh(1).

The hatimerun utility runs the program prog with arguments args as a child subprocess under a timeout, and as its own process group. The timeout is specified in seconds, by the -t timeOutSecs option. If the timeout expires, then hatimerun kills the child subprocess's process group with a SIGKILL signal, and then exits with exit code 99.

You can run this command in the global zone or in a non-global zone. The command affects only the global or non-global zone in which you issue the command.

OPTIONS

The following options are supported:

.na -a .ad Changes the meaning of hatimerun radically: instead of killing the child when the timeout expires, the hatimerun utility simply exits, with exit code 99, leaving the child to run asynchronously. It is illegal to supply both the -a option and the -k option.

.na -e .ad Changes the exit code for the timeout case to some other value than 99.

.na -k .ad Specifies what signal is used to kill the child process group. The possible signal names are the same as those recognized by the kill(1) command. In particular, the signal name should be one of the symbolic names defined in the <signal.h> description. The signal name is recognized in a case-independent fashion, without the SIG prefix. It is also legal to supply a numeric argument to the -k option, in which case that signal number is used. It is illegal to supply both the -a option and the -k option.

.na -t .ad Specifies the timeout period, in seconds.

.na -v .ad Verbose output, on stderr.

EXIT STATUS

If the timeout occurs, then hatimerun exits with exit code 99 (which can be overridden to some other value using the -e option).

If the timeout does not occur but some other error is detected by the hatimerun utility (as opposed to the error being detected by the child program), then hatimerunhatimerun exits with exit code 98.

Otherwise, hatimerun exits with the child's exit status.

The hatimerun utility catches the signal SIGTERM. It responds to the signal by killing the child as if a timeout had occurred, and then exiting with exit code 98.

ATTRIBUTES

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

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWscu
Interface StabilityEvolving
SEE ALSO

kill(1), sh(1), attributes(5)