Customization
orderly manner. Doing so helps to avoid termination of the application tasks and loss of
data when the system is shut down.
Your start and stop script should accept a "stop" parameter which will send signals to
your application and daemon tasks, arranging for an orderly shutdown. Tasks that are not
shut down in an orderly manner at this time are terminated by the operating system
during the last stage of system shutdown.
Triggers
The internal middleware supporting the Web administration and internal operations of
the Magnia SG20 are based on a trigger mechanism. Triggers are scripts (or sets of
scripts) that are executed when certain events occur on the system. Though triggers may
perform other tasks, the two primary tasks they perform are typically the regeneration of
template-based configuration files, and the stopping and starting of various related
system services. Magnia SG20 trigger scripts are written in Perl.
Events that cause triggers to be executed usually involve any detected change in the
state or configuration of a specific system area or service. For example, the networking
triggers may be executed when there is a change in the IP address of the public port
(such as when a DHCP address is acquired). Triggers are also executed when a change
is made through the Web administration user interface. For example, adding or deleting a
user could execute the mod_users trigger to regenerate various password and user
configuration files.
Triggers can be useful when integrating your application into the Magnia SG20 system.
❖
If you change configuration file templates, you can regenerate all the affected
configurations and enable the change to become effective by launching the
associated trigger.
❖
You can add your own trigger scripts to existing triggers.
The core of the trigger mechanism is a series of directories, (one per trigger, and named
after the trigger), that are organized under /sa2/triggers. These directories may be
nested as deeply as desired for organizational purposes, but the trigger name is the
portion of the directory path relative to /sa2/triggers. Each directory contains scripts
that execute actions that are tied to the trigger. The actions most likely include, but are
not limited to, regenerating the template files for each dependent application, and then
restarting the dependent service. The scripts in each trigger directory should be indexed
by a zero-padded numeric string in a manner similar to the templates. The scripts are
executed in the order that ls –l [0-9]* produces; therefore, the filename of each
script must start with a number.
25
Triggers
Need help?
Do you have a question about the SG20 - Magnia - Web Server and is the answer not in the manual?
Questions and answers