Xentara v2.0.4
User Manual
Operational Stages

Xentara has a number of different operational stages that it traverses during its run time. Xentara has the following stages:

Startup Stage

In this stage, Xentara perfroms one-time initialization when it is started.

Pre-Operational Stage

In this stage, Xentara prepares all systems before entering the operational stage.

Operational Stage

In this stage, Xentara perfroms its normal operational tasks. This is the stage that Xentara is in during normal operation.

Post-Operational Stage

In this stage, Xentara cleans up all systems after leaving the operational stage.

Shutdown Stage
In this stage, Xentara perfroms one-time cleanup before it is terminated.

Normal operation of xentara can be suspended without stopping Xentara completely. If xentara is suspended, an additional stage is entered:

Suspended Stage
In this stage, Xentara is idle and performs only minimum necessary maintenace tasks.

Sequence of Stages

When Xentara is started, the Startup stage is executed, followed by the pre-operational stage. After the pre-operational stage has completed, Xentara will go into the operational stage. The operational stage is then executed until Xentara is stopped. Once Xentara is stopped, the post-operational stage is executed, followed by the shutdown stage. After the shutdown stage has completed, the Xentara application will exit.

Here is the sequence of stages when Xentara is started and stopped:

Xentara can be suspended during operation without completely shutting it down. When Xentara receives a suspend request, the post-operational stage is executed, after which Xentara goes into the suspended stage. Xentara remains in the suspended stage until a resume command is received. When a resume command is received, the pre-operational stage is executed. After the pre-operational stage has completed, Xentara will go back into the operational stage.

Here is the sequence of stages when Xentara is suspended and resumed:

The Individual Stages

The exact actions perfromed during each stage are determined by the individual skills and skills. This chapter only describes the general type of action perfromed in the different stages.

The Startup Stage

In the startup stage, skills and skills perform one-time intialization that doesn't need to be redone after a suspend and resume. This is usually limited to initializing local hardware, like network interfaces or serial ports.

The Pre-Operational Stage

In the pre-operational stage, skills and skills perform initialization that is necessary for proper operation of xentara. Specifically, skills will open connections to remote devices and read the values of all the inputs.

After the pre-operational stage has finished, all data points will contain valid values, as long as the underlying data source (e.g. the physical hardware they are read from) is functioning correctly. Only data points whose underlying data source is offline or otherwise cannot provide data, will contain errors.

The Operational Stage

In the operational stage, skills and skills perform their main function. Specifically, I/O component are serviced normally, and skill elements perform their operations normally. The operational stage is maintained until Xentara is shut down or operation is suspended.

The Post-Operational Stage

In the pre-operational stage, skills and skills perform cleanup for the actions taken in the operational stage. Specifically, skills will close all connections to remote devices and invalidate the values of the inputs.

The Shutdown Stage

In the shutdown stage, skills and skills perform perform cleanup for the actions taken in the startup stage.

The Suspended Stage

In the suspended stage, skills and skills only perfrom minimal maintenance tasks. Timers and events are no longer processed, and no data is generally available.

Suspending and Resuming Xentara

Suspending and Resuming Xentara Using the Xentara Debugger

You can use the Xentara Debugger to suspend and resume Xentara. Start the debugger to connect to Xentara, and type “suspend” or “resume” at the debugger prompt.

Suspending and Resuming Xentara Using Signals (Linux only)

Under Linux, Xentara can be suspended by sending it the signal USR1. To resume Xentara when it is suspended, send USR2.

Sending Signals To a systemd Service

If Xentara is running as a systemd service as described in systemd Service, you can use systemctl to send signals to Xentara. To suspend a Xentara service running under the user name username, use the following command:

sudo systemctl kill -s USR1 xentara@username.service

To resume the same Xentara instance, use the following command:

sudo systemctl kill -s USR2 xentara@username.service
Attention
Don’t forget to replace username with the correct user name.
Note
The user executing these commands will need special privileges to be able to use sudo(8). This is usually accomplished by adding the user to the sudo user group. This can only be done by the root user, or by another user that already has sudo access.
man pages
systemctl(1)

Sending Signals to a Manually Started Process

If you have started xentara manually, or if you used a different mechanism than systemd to start Xentara. You must use a different method of sending the USR1 and USR2 signals. If you know the PID of the xentara instance you want to suspend or resume, you can use the kill command to send the signals. To suspend the Xentara instance with PID 2488, use the following command:

pkill -USR1 2488

To resume the Xentara instance with PID 2488, use the following command:

pkill -USR2 2488
Attention
Don’t forget to replace 2488 with the correct PID.

If you do not know the PID of the xentara instance you wish to suspend or resume, you can use the pkill command to send the signal to all all running xentara instances:

pkill -USR1 xentara

To resume all running xentara instances, use the following command:

pkill -USR2 xentara
man pages
kill(1), pkill(1)

Suspending and Resuming Xentara From Remote Clients

Some Xentara remote client interfaces, like the Xentara WebSocket interface allow privileged clients to suspend and resume Xentara. The remote client must have the “suspend” entitlement in order to suspend and resume Xentara.

Fot the Xentara Websocket interface, please refer to the Xentara WebSocket API Specification on information on hopw to suspend and resume Xentara using the WebSocket API. For remote client connection provided by skills, please refer to the documentation fo the corresponding skill on whether and how clients can suspend and resume Xentara.