tadd

Index Home MAE > MAE Architecture > MAE Utilities > MAE Control Utilities > tadd

tadd

This command adds a new task (daemon or job) and registers it with commhub. It does not start the daemon. It must be run on the root commhub instance.

The command syntax is:

tadd [filename(s)]

tadd [options]

Where,

Option

Description

-name

The name of the task. Must be new and unique. Must be specified; cannot be empty.

-exec

The command line inovakation with path and options that specifies how to execute this option. Must be specified; cannot be blank.

-J | -job

This option specifies that the task executes and exits; it does not continuously run like a daemon.  Default: Daemon (not job).

-D | -daemon

This option specifies that the task starts and is expected to run until told to stop; it does exit on its own like a job. Default: Daemon (not job).

-multiexec

This option means the task may launch multiple instances of itself - and that's OK. Otherwise, a repeat instances are not allowed to re-connect to commhub. Default: not multi-exec.

-oneshot

This option means the task may only have one instance launched at a time, repeat instances as managed by commhub. Default: not one-shot.

-db

By default, a task is not allowed access to the data store. Specify this option to allow that access.

-nodb

Specify that the task is not allowed access to the data store. This is the default.

-msg

By default, a task is not allowed access to send/receive messages. Specify this option to allow that access.

-nomsg

Specify that the task is not allowed access to send/receive messages. This is the default.

-Full | -full

By default, no integration is assumed between the task and commhub. Use this option to declare this task fully integrates with commhub; that is, it maintains a connection with commhub, receives commands from commhub, and sends requests to commhub.

-Semi | -semi

By default, no integration is assumed between the task and commhub. Use this option to declare this task semi-integrates with commhub; that is, it reports its status to commhub - initializing, ready, exited. It does not maintain a connection with commhub, so no commands can be received.

-None | -none

Use this option to declare this task has no integration with commhub; that is, it does not report its status to commhub and definitely does not maintain a connection with commhub, so no commands can be received. This is the default integration.

-dep

Specify other tasks by name (in comma delimited list) that this task depends upon to be running before this task can start.

-exitto

Exit timeout - the number of seconds to wait for this task to exit when told to exit before commhub sends OS termination signals (if task running on same host as commhub).  Default: 1 second.

-watchto

Watchdog timeout - the number of seconds to wait for a response before commhub considers the task hung and unable to continue.  A hung task will be terminated using OS termination signals.  Default: 60 seconds.

-proxy | -spoke

Specify the proxy host or spoke name where the task runs.

-schedule

Not implemented.  The scheduled times when to start this task.

filename

All the daemon options are inside the CSV filename, which has the same exact headers as mgmttaskdb.csv.


File Format

The provided file must be in CSV format with the following fields.

Field

Description

Id

In the mgmttaskdb, this is the record id. Just use a low number; tadd will change it before adding this information to /usr/mae/conf/mgmttaskdb.csv.

Name

This is the name of your MAE program. It does not need to match the channel your program uses, but it must match the name that your program uses when talking with CommHub, e.g. the MAEApp/MAEDaemon/MAEUtility line that declares maeapp.

Restart

This true/false flag tells CommHub if this MAE task should be restarted if it quits/fails on its own. If T for true, CommHub will ensure it is restarted when it fails. CommHub uses a back-off algorithm to give increasing amounts of time before restarting a constantly failing program.  If a user issues tstop, then CommHub will not restart the program.

Enabled

This true/false flag tells CommHub whether this application is allowed to run or not.  If T for true, the application may run; if F for false, CommHub will not allow the application to connect and participate in this MAE ecosystem instance.

MultiExec

This true/false flag tells CommHub if multiple instances of this program are permitted to run at once or if this program may only have one instance running.  Note that the base instance of a program is instance 0; successive instances must be unique with a value of 1 or larger. To view all instances of a running program (e.g. the iogw program), use

tstatus iogw.*

If T for true, CommHub will allow multiple instances; if F for false, it will reject attempts by other instances to participate in this MAE ecosystem instance.

DbPermit

This true/false flag tells CommHub whether this program is allowed to access the database via dbbroker or not.  If T for true, the program may access the database.

MsgPermit

This true/false flag tells CommHub whether this program is allowed to send and receive messages via msgbroker or not.  If T for true, the program may send and receive messages.

Command

This is the command (with full path) and command line parameters needed to start the program.

Integration

This is the integration level implemented by the program.

Integration Level

Description

1

Fully integrated: it maintains a connection with CommHub, receives commands from CommHub, and sends requests to CommHub.

2

Semi-integrated: it reports its status to CommHub - initializing, ready, exited. It does not maintain a connection with CommHub, so no commands can be received.

3

Non-integrated: it does not report its status to CommHub and definitely does not maintain a connection with CommHub, so no commands can be received.


DepList

This is a list of one or more other programs that must be running before this program can run.  At this time, only one dependency is supported.

ClusterName

This is the name of the CommHub spoke where the program runs. If not specified, the program will be launched on the root CommHub. Note that the spoke CommHub must connect to CommHub before CommHub can launch the program there.

ExitTimeout

This is a count of the number of seconds that CommHub will permit this program to clean up and exit when it's been told to stop. After the timeout, the program will be forced to quit via OS signal.

WatchdogTimeout

This is a count of the number of seconds that CommHub will permit this program to run without any response before determining that this program is hung/frozen/unresponsive.  A hung program is killed via OS signal and restarted.

ProxyHost

This field is not presently used.

Schedule

This field is not presently used.


Here is an example file:

Id,Name,Restart,Enabled,MultiExec,DbPermit,MsgPermit,Command,Integration,DepList,ClusterName,ExitTimeout,WatchdogTimeout,ProxyHost,Schedule

4,hello,T,T,F,T,T,/usr/mae/bin/hello,1,msgbroker,,1,60,,

See Also

tdel, tstart, tstatus