/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* */ /* */ /* Licensed Materials - Property of IBM */ /* */ /* (C) COPYRIGHT International Business Machines Corp. 1996,2021 */ /* All Rights Reserved */ /* */ /* US Government Users Restricted Rights - Use, duplication or */ /* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /* */ /* IBM_PROLOG_END_TAG */ static const char *sccsid = "@(#)92 1.15 src/rsct/pgs/samples/sample_schg.c, gssamples, rsct_rady, radys003a 6/6/21 12:23:54"; #if !defined(_HAGSD_COPYRIGHT_H) #define _HAGSD_COPYRIGHT_H static const char copyright[] = "Licensed Materials - Property of IBM\n\ (C) COPYRIGHT International Business Machines Corp. 1996,2001.\n\ All Rights Reserved.\n\ US Government Users Restricted Rights - Use, duplication or \n\ disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n"; #endif #if defined(__linux__) || defined(__INTERIX) || defined(__sun) #define NFDS(a) a #endif /*********************************************************************/ /* * Name: sample_schg.c * * This module provides a non-interactive program that can be used as * an example for constructing an application that exploits the Group * Services interfaces provided by IBM RSCT. * * Components: * sample_schg.c - is the bulk of the program, and contains the main() * function, as well as all necessary callback functions, and some * internal utility functions for the application. * * sample_utility.c - provides the definitions for the utility functions * used by the sample_test and sample_schg programs. * * sample_utility.h - declarations for the utility functions contained * in sample_utility.c * * This program is intended as a "simple" Group Services application. * When started, it will: * * - read and validate the command-line arguments to set various * options, such as group name and timing options. * - attempt to initialize itself as a Group Services client. * - once initialized, attempt to join the group as a provider. * - once joined, each provider will use the timing control given * and will propose a group state value change at each desired * time interval. * - this continues until the program is killed (via kill command, * or otherwise sending it a signal.) * * The group name, protocol controls, and the various timing aspects * of the program are controllable via command-line arguments. * * This program will write out informational messages as it goes along * on stdout. It is recommended to run this program in the background, * and to redirect stdout to a file, and monitor the program by * monitoring the file. */ /*********************************************************************/ /*********************************************************************/ /* * To build this program, use the Makefile in this directory: * * make all (to build all sample programs) * or * make sample_schg * * To execute this program, you need to have Group Services active on * your system. Please refer to the manual if you have questions as to * how you may verify this. Additionally, you need to execute as a * privileged (root) process. Also, you should take care in the group * names you use, to avoid clashing with other groups. * * Prior to starting this program, you need to set the name of your SP * partition in the environment of the process running the program. * You should export the variable HA_SYSPAR_NAME to be the name of the * partition. Contact your system administrator if you do not know how * to determine this. * * Once all this is done, you can then start up copies of this program * on as many nodes as desired. All of those with the same group name * will attempt to join the same group. For these, you should ensure * that any specified protocol control arguments match, to ensure that * the group attributes all match. If this is not done, then not all * copies of the program will be allowed to join the group. */ /*********************************************************************/ /*********************************************************************/ /* * Command-line arguments: * * -g -- name of the group this process should join. * Default is "SampleGroup01". * * -t