Xentara v1.2.1
User Manual
Loading...
Searching...
No Matches
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 I/O drivers and service providers. This chapter only describes the general type of action perfromed in the different stages.

The Startup Stage

In the startup stage, I/O drivers and service providers 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, I/O drivers and service providers perform initialization that is necessary for proper operation of xentara. Specifically, I/O drivers will open connections to remote devices and read the values of all the inputs.

After the pre-operational stage has finished, all I/O points will contain valid values, as long as the I/O component they belong to is functioning correctly. Only I/O points whose I/O components are offline or otherwise cannot provide data, will contain errors.

The Operational Stage

In the operational stage, I/O drivers and service providers perform their main function. Specifically, I/O component are serviced normally, and microservices perform their operate normally. The operational stage is maintained until Xentara is shut down or operation is suspended.

The Post-Operational Stage

In the pre-operational stage, I/O drivers and service providers perform cleanup for the actions taken in the operational stage. Specifically, I/O drivers will close all connections to remote devices and invalidate the values of the inputs.

The Shutdown Stage

In the shutdown stage, I/O drivers and service providers perform perform cleanup for the actions taken in the startup stage.

The Suspended Stage

In the suspended stage, I/O drivers and service providers 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 . 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)