[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 2

hagsctrl Command

Purpose

Starts the group services subsystems.

Syntax

hagsctrl {-a | -s | -k | -d | -c | -u | -t | -o | -r | -h}

Description

Group services provides distributed coordination and synchronization services for other distributed subsystems running on a set of nodes on a cluster. The hagsctrl control script controls the operation of the subsystems that are required for group services. These subsystems are under the control of the system resource controller (SRC) and belong to a subsystem group called hags. Associated with each subsystem is a daemon.

An instance of the group services subsystem executes on the control workstation and on every node of a system partition. Because group services provides its services within the scope of a system partition, its subsystems are said to be system partition-sensitive. This control script operates in a manner similar to the control scripts of other system partition-sensitive subsystems. It can be issued from either the control workstation or any of the system partition's nodes.

From an operational point of view, the group services subsystem group is organized as follows:

Subsystem
group services
Subsystem group
hags
SRC subsystem
hags

The hags subsystem is associated with the hagsd daemon.

The subsystem name on the nodes is hags. The hags subsystem on each node is associated with the system partition to which the node belongs.

On the control workstation, there are multiple instances of the subsystem, one for each system partition. Accordingly, the subsystem names on the control workstation have the system partition name appended to them. For example, for system partitions named sp_prod and sp_test, the subsystems on the control workstation are named hags.sp_prod and hags.sp_test.

Daemons
hagsd

The hagsd daemon provides the majority of the group services functions.

The hagsctrl script is not normally executed from the command line. It is normally called by the syspar_ctrl command during installation of the system, and partitioning or repartitioning of the system.

The hagsctrl script provides a variety of controls for operating the group services subsystems:

Before performing any of these functions, the script obtains the current system partition name (using the spget_syspar command) and the node number (using the node_number ) command. If the node number is zero, the control script is running on the control workstation.

Except for the clean and unconfigure functions, all functions are performed within the scope of the current system partition.

Adding the Subsystem

When the -a flag is specified, the control script uses the mkssys command to add the group services subsystems to the SRC. The control script operates as follows:

  1. It makes sure the hags subsystem is stopped.
  2. It gets the port number for the hags subsystem for this system partition from the Syspar_ports class of the System Data Repository (SDR) and ensures that the port number is set in the /etc/services file. If there is no port number in the SDR and this script is running on the control workstation, the script obtains a port number. If the script is running on a node and there is no port number in the SDR, the script ends with an error. The range of valid port numbers is 10000 to 10100, inclusive.

    The service name that is entered in the /etc/services file is hags.syspar_name.

  3. It removes the hags subsystem from the SRC (just in case it is still there).
  4. It adds the hags subsystem to the SRC. The system partition name is configured as a daemon parameter on the mkssys command.
  5. It adds an entry for the hags group to the /etc/inittab file. The entry ensures that the group is started during boot. However, if hagsctrl is running on a High Availability Control Workstation (HACWS), no entry is made in the /etc/inittab file. Instead, HACWS manages starting and stopping the group.

Starting the Subsystem

When the -s flag is specified, the control script uses the startsrc command to start the Group Services subsystems hags.

Stopping the Subsystem

When the -k flag is specified, the control script uses the stopsrc command to stop the Group Services subsystemshags.

Deleting the Subsystem

When the -d flag is specified, the control script uses the rmssys command to remove the Group Services subsystem from the SRC. The control script operates as follows:

  1. It makes sure the hags subsystem is stopped.
  2. It removes the hags subsystems from the SRC using the rmssys command.
  3. It removes the port number from the /etc/services file.
  4. If there are no other subsystems remaining in the hags group, it removes the entry for the hags group from the /etc/inittab file.

Cleaning Up the Subsystems

When the -c flag is specified, the control script stops and removes the group services subsystems for all system partitions from the SRC. The control script operates as follows:

  1. It stops all instances of subsystems in the subsystem group in all partitions, using the stopsrc -g hags command.
  2. It removes the entry for the hags group from the /etc/inittab file.
  3. It removes all instances of subsystems in the subsystem group in all partitions from the SRC using the rmssys command.

Unconfiguring the Subsystems

When the -u flag is specified, the control script performs the function of the -c flag in all system partitions and then removes all port numbers from the SDR allocated by the group services subsystems.

Note
The -u flag is effective only on the control workstation.

Prior to executing the hagsctrl command with the -u flag on the control workstation, the hagsctrl command with the -c flag must be executed from all of the nodes. If this subsystem is not successfully cleaned from all of the nodes, different port numbers may be used by this subsystem, leading to undefined behavior.

Turning Tracing On

When the -t flag is specified, the control script turns tracing on for the hagsd daemon, using the traceson command.

Turning Tracing Off

When the -o flag is specified, the control script turns tracing off (returns it to its default level) for the hagsd daemon, using the tracesoff command.

Refreshing the Subsystem

The -r flag has no effect for this subsystem.

Logging

While they are running, the group services daemons provide information about their operation and errors by writing entries in a log file in the /var/ha/log directory.

Each daemon limits the log size to a pre-established number of lines (5000 by default). When the limit is reached, the daemon appends the string .bak to the name of the current log file and begins a new log. If a .bak version already exists, it is removed before the current log is renamed.

Flags

-a
Adds the subsystems.
-s
Starts the subsystems.
-k
Stops the subsystems.
-d
Deletes the subsystems.
-c
Cleans the subsystems, that is, delete them from all system partitions.
-u
Unconfigures the subsystems from all system partitions.
-t
Turns tracing on for the subsystems.
-o
Turns tracing off for the subsystems.
-r
Refreshes the subsystem.
-h
Displays usage information.

Security

You must have root privilege to run this script.

Exit Status

0
Indicates the successful completion of the command.
1
Indicates that an error occurred.

Restrictions

This command is valid in a PSSP environment only.

Standard Output

When the -h flag is specified, this command's usage statement is written to standard output.

Standard Error

This command writes error messages (as necessary) to standard error.

Examples

  1. To add the group services subsystems to the SRC in the current system partition, set the SP_NAME environment variable to the appropriate system partition name and enter:
    hagsctrl -a
  2. To start the group services subsystems in the current system partition, set the SP_NAME environment variable to the appropriate system partition name and enter:
    hagsctrl -s
  3. To stop the group services subsystems in the current system partition, set the SP_NAME environment variable to the appropriate system partition name and enter:
    hagsctrl -k
  4. To delete the group services subsystems from the SRC in the current system partition, set the SP_NAME environment variable to the appropriate system partition name and enter:
    hagsctrl -d
  5. To clean up the group services subsystems on all system partitions, enter:
    hagsctrl -c
  6. To unconfigure the group servicess subsystem from all system partitions, on the control workstation, enter:
    hagsctrl -u
  7. To turn tracing on for the group services daemon in the current system partition, set the SP_NAME environment variable to the appropriate system partition name and enter:
    hagsctrl -t
  8. To turn tracing off for the group services daemon in the current system partition, set the SP_NAME environment variable to the appropriate system partition name and enter:
    hagsctrl -o

Location

/usr/sbin/rsct/bin/hagsctrl

Files

/var/ha/log/hags_nodenum_instnum. syspar_name
Contains the log of the hagsd daemons on the nodes.
/var/ha/log/hags.syspar_name_nodenum_instnum.syspar_name
Contains the log of each hagsd daemon on the control workstation.

The file names include the following variables:

Related Information

Commands: lssrc, startsrc, stopsrc, syspar_ctrl

Daemons: hagsd

Books: for information about the system resource controller (SRC), see AIX General Programming Concepts: Writing and Debugging Programs

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]