manager2.yml

This is an annotated example of an input file to the manager2 component, with user documentation here.

ManagedProcess:
# The following examples should run from the build directory
# 'dummytask' is a simple test program that takes two arguments: a delay [seconds] and an action.
# After the specified delay 'dummytsk' will end its execution according to the specified action:
# - success: return EXIT:SUCCESS
# - error: return EXIT_FAILURE
# - throw: throw an unhandled exception
# - sigkill: send a KILL signal to itseelf
#
# The following task will start once
- PrgName: tools/dummytask/dummytask
Arguments: [4, success]
# The following task will return successfully after four seconds and then restart after ten more
# seconds. This periodic execution will run indefinently, unless some failure arises, in which case
# the task will not be restarted.
- PrgName: tools/dummytask/dummytask
Arguments: [4, success]
RestartPeriod: 10
# The following task will return failure after one second and then restart after thirty more
# seconds. The number of attempts to restart the task is unlimited.
- PrgName: tools/dummytask/dummytask
Arguments: [2, error]
RestartPeriod: 600 # If the task were to return success, this would trigger a new execution of the task after ten minutes
DelayOnError: 30
# The following task will return failure after two seconds and then restart after three more
# seconds. The task will attempted to be restarted two times (three starts all in all), before giving up.
- PrgName: tools/dummytask/dummytask
Arguments: [2, error]
RestartPeriod: 15 # If the task were to return success, this would trigger a new execution of the task after 15 seconds
DelayOnError: 3
MaxRestartsOnError: 2
# The following task will fail after two seconds and then restart after three more seconds. After two
# attempts to be restart the task, the next restart attempt will be delayed by 8 seconds.
- PrgName: tools/dummytask/dummytask
Arguments: [2, throw]
RestartPeriod: 15 # If the task were to return success, this would trigger a new execution of the task after 15 seconds
DelayOnError: 3
MaxRestartsOnError: 2
DelayOnErrorLong: 8 # This should be set to a value not smaller than 'DelayOnError'.
# The following task will fail after 8 seconds and then restart after three more seconds.
# 'ResetFailCounterAfter: 6' will trigger a reset of a fail counter after the task has been running for 6 seconds.
# So in this case the task will be restarted after 'DelayOnError' each time it fails (since it fails after 8 seconds)
# indefinently.
- PrgName: tools/dummytask/dummytask
Arguments: [8, throw]
RestartPeriod: 15 # If the task were to return success, this would trigger a new execution of the task after 15 seconds
DelayOnError: 3
MaxRestartsOnError: 2
DelayOnErrorLong: 8 # This should be set to a value not smaller than 'DelayOnError'.
ResetFailCounterAfter: 6 # A default value of three seconds will be used if this is not set.
# The following example includes a watchdog timer. The watchdog timer is started on successfull start of the task.
# The watchdog is intended to restart the task in cases in which the task execution is somehow aborted without
# the normal exit handler being triggerd (i.e. the RatatoskManager will not be alerted by the halted execution.
- PrgName: tools/dummytask/dummytask
Arguments: [60, sigkill]
RestartPeriod: 600 # If the task were to return success, this would trigger a new execution of the task after ten minutes
DelayOnError: 30
WatchdogPeriod: 10
# The following example includes monitoring of output from dummytask to stdout
# A watchdog will check every 'MaxQuietPeriod' if the time since last registered output from the task
# was recieved later than 'MaxPeriod' seconds ago. If no output has been recieved, the manager will terminate dummytask and
# restart it. The restart can be delayed after termination of the task by adding 'DelayOnError'.
ManagedProcess:
- PrgName: tools/dummytask/dummytask
Arguments: [5, success, 500]
MaxQuietPeriod: 2