SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE




YUM REPOSITORY

 
 

MAN page from Mandriva 2011 socklog-2.1.0-5mdv2010.0.i586.rpm

tryto

Section: User Commands (1)
Index 

NAME

tryto - tries to run a command limited by a timeout or number of tries,can be used to run as svlogd(8) processor. 

SYNOPSIS

tryto[-pPv] [-tsec][-kksec][-ntries]prog 

DESCRIPTION

progconsist of one or more arguments.

trytoruns and watchesprog,feeding its standard input toprog'sstandard input.Ifprogexits with a return code other then 0,trytorunsprogagain after sleeping one second.

If the number of retries reaches the maximalnumber oftries,trytoprints an error message and gives up.

If the timeoutsecseconds is reached andprogis still running,trytosends a TERM signal toprog,waitsksecseconds forprogto terminate, then sends a KILL signal ifprogstill is there, and exits as soon as possible. 

OPTIONS

-t sec
timeout.Set the timeout to send TERM toprogtosecseconds.Default is 180.
-k ksec
kill timeout.Set the timeout to send KILL toprogtoksecseconds.Default is 5.
-n tries
Set the maximal number of tries totries.Ifprogexited with a return code other that 0,trytotries to rewind standard input to the beginning usinglseek(2)before startingprogagain.Default is 5.
-p
processor.Use this option if you runtrytoas asvlogd(8)processor (see below).
-P
process group.Runprogin a new session and process group, and send signals on timeout toprog'sprocess group instead of its pid.
-v
verbose.Print verbose messages to standard error.
 

PROCESSOR

Iftrytosees the-poption,trytoruns as asvlogd(8)ormultilog(8)processor, making use of filedescriptors 4 and 5:

Before startingprog,trytomoves the filedescriptor 5 to 2, so all error messages fromtrytoandprogwill be saved insvlogd(8)'sstateto be processed on the next run oftryto -p.

After startingprog,trytofirst feeds all data it reads from filedescriptor 4 intoprog'sstandard input, then all data from filedescriptor 0.

Ifprogfails by timeoutsecseconds or maximal number oftries,trytoprints all data from standard input to standard output, an error messageto standard error, and exits with 0. 

EXIT CODES

Iftrytoitself fails, it returns 111.

Iftrytoruns as asvlogd(8)processor,trytoreturns 0 in all other cases.

Ifprogwas run successfully,trytoreturns 0.

Ifprogfailed by timeout,trytoreturns 100.

Ifprogfailed by maximal number oftries,trytoreturns the last return code fromprog.

 

SEE ALSO

socklog(8),uncat(1),svlogd(8),multilog(8),lseek(2)


 http://smarden.org/socklog/
 http://smarden.org/runit/ 

AUTHOR

Gerrit Pape <papeAATTsmarden.org>


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
PROCESSOR
EXIT CODES
SEE ALSO
AUTHOR

This document was created byman2html,using the manual pages.