Starting Policy Agent as a started task

Use the S PAGENT command on an MVS™ console or SDSF to start Policy Agent. A sample procedure is included in member EZAPAGSP in SEZAINST. All of the information regarding default locations for the configuration and log files is the same as for starting from the z/OS® shell.

The Policy Agent requires access to one or more DLLs at runtime. The LIBPATH environment variable must be set to include the /usr/lib directory, which normally includes all the required DLLs.

In order for policy time specifications to be properly acted upon, the TZ environment variable needs to be set to local time.

Set the LIBPATH and TZ environment variables as follows:
  • Specify LIBPATH and TZ using the ENVAR parameter on the PARM statement in the started procedure. For example:
    // PARM=('POSIX(ON) ALL31(ON)', 
    // 'ENVAR("LIBPATH=/usr/lib"', 
    // '"TZ=EST5EDT4")/')
  • Export the LIBPATH and TZ environment variables in a file specified with the STDENV DD statement. For example:
    //STDENV DD PATH='/etc/pagent.env',PATHOPTS=(ORDONLY)
    In the /etc/pagent.env file:
    LIBPATH=/usr/lib
    TZ=EST5EDT4 
    See z/OS Language Environment Programming Guide for more information about specifying runtime options and environment variables. See z/OS UNIX System Services Command Reference for details about setting the LIBPATH and TZ environment variables.

Below is a copy of the sample procedure:


//PAGENT   PROC
//*
//* IBM Communications Server for z/OS
//* SMP/E distribution name: EZAPAGSP
//*
//* 5650-ZOS Copyright IBM Corp. 1998, 2013
//* Licensed Materials - Property of IBM
//* "Restricted Materials of IBM"
//* Status = CSV2R1
//*
//PAGENT   EXEC PGM=PAGENT,REGION=0K,TIME=NOLIMIT,
//       PARM='ENVAR("_CEE_ENVFILE_S=DD:STDENV")/'
//*
//*** Policy Agent parameters:
//*
//*   -c filename
//*
//*   Specifies the MVS data set or z/OS UNIX main configuration file.
//*   The syntax for an MVS data set is "//'MVS.DATASET.NAME'" and the
//*   syntax for a z/OS UNIX file is /dir/file.  This start option
//*   overrides the environment variable PAGENT_CONFIG_FILE if it is
//*   specified.  The default value is /etc/pagent.conf.
//*
//*   -d n
//*
//*   Specifies a debug level.  See Communications Server IP
//*   Diagnosis for a decscription of the debug levels.
//*
//*   -i
//*
//*   Specifies that Policy Agent should read configuration files
//*   immediately if they are changed.
//*
//*   -t n
//*
//*   Specifies the LDAP client trace level.  The only supported values
//*   are 1 to turn on tracing or 0 to turn off tracing.
//*
//*   -l filename | SYSLOGD
//*
//*   Specifies the destination of the Policy Agent log file.  You
//*   can specify a z/OS UNIX file name or the value SYSLOGD in
//*   uppercase.  SYSLOGD is recommended because it routes log output
//*   to the syslog daemon.  This start option overrides the environment
//*   variable PAGENT_LOG_FILE if it is specified.  The default value
//*   is /tmp/pagent.log.
//*
//*   -m n
//*
//*   Specifies that Policy Agent should enable memory tracing.  See
//*   Communications Server IP Diagnosis for more information on
//*   memory tracing.
//*
//*** Examples for specifying environment variables and parameters
//*** (parameters must extend to column 71 and be continued in
//*** column 16):
//*
//*  Example 1: Environment variables inline, MVS config data set
//*
//*      PARM=('ENVAR("LIBPATH=/usr/lib","TZ=EST5EDT")/-c //''USER.TCPP
//*            ARMS(PAGENT)'' -l SYSLOGD')
//*
//*  Example 2: Environment variables inline, UNIX config file
//*
//*      PARM=('ENVAR("LIBPATH=/usr/lib","TZ=EST5EDT")/-c /etc/pagent3.
//*            conf -l SYSLOGD')
//*
//*  Example 3: Environment variables in STDENV DD
//*
//*      PARM='ENVAR("_CEE_ENVFILE_S=DD:STDENV")/'
//*
//*   For this method, the STDENV DD statement below must be
//*   changed to point to a MVS data set or UNIX file containing
//*   settings for any environment variables.  For example, it should
//*   contain at least LIBPATH and TZ (unless you choose to specify TZ
//*   in a different fashion), but can contain other environment
//*   variables as in this example:
//*
//*     PAGENT_CONFIG_FILE=/etc/pagent2.conf
//*     PAGENT_LOG_FILE=SYSLOGD
//*     LIBPATH=/usr/lib
//*     TZ=EST5EDT
//*
//*   If you want to include comments in the data set or
//*   z/OS UNIX file, specify the _CEE_ENVFILE_COMMENT
//*   environment variable as the first environment variable
//*   in the data set or file.  The value specified for
//*   the _CEE_ENVFILE_COMMENT variable is the comment character.
//*   For example, if you want to use the pound sign, #, as
//*   the comment character, specify this as the first
//*   statement:
//*     _CEE_ENVFILE_COMMENT=#
//*
//*   The use of the STDENV DD statement works well when more than
//*   one environment variable is specified, as there is a JCL limit
//*   of 100 characters on the PARM statement.
//*
//*   Note: Language Environment recommends a variable record format
//*         for the STDENV file.
//*
//*   You can also set the TZ environment variable for all applications
//*   in the CEEPRMxx PARMLIB member.  You should define the TZ
//*   environment variable for all three LE option sets (CEEDOPT,
//*   CEECOPT, and CELQDOPT).  For example:
//*
//*     CEECOPT(ALL31(ON), ENVAR('TZ=EST5EDT') )
//*     CEEDOPT(ALL31(ON), ENVAR('TZ=EST5EDT') )
//*     CELQDOPT(ALL31(ON), ENVAR('TZ=EST5EDT') )
//*
//*   For more information on specifying run-time options, see z/OS
//*   Language Environment Programming Guide. For details on setting
//*   the LIBPATH and TZ environment variables, see z/OS UNIX System
//*   Services Command Reference.
//*
//STDENV   DD DUMMY
//* Sample MVS data set containing environment variables:
//*STDENV   DD DSN=TCPIP.PAGENT.ENV(PAGENT),DISP=SHR
//* Sample UNIX file containing environment variables:
//*STDENV   DD PATH='/etc/pagent.env',PATHOPTS=(ORDONLY)
//*
//* Output written to stdout and stderr goes to the data set or
//* file specified with SYSPRINT or SYSOUT, respectively.  But
//* normally, PAGENT doesn't write output to stdout or stderr.
//* Instead, output is written to the log file, which is specified
//* by the -c startup option, the PAGENT_LOG_FILE environment
//* variable, or the default of /tmp/pagent.log.  For severe
//* startup errors, such as incorrect startup options specified,
//* or being unable to open the log file, log output is instead
//* written to the syslog daemon, and help text is written to
//* stdout.
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//*
//CEEDUMP  DD SYSOUT=*,DCB=(RECFM=FB,LRECL=132,BLKSIZE=132)
Figure 1. PAGENT sample procedure
Restriction: When you use the environment variable _CEE_ENVFILE with an MVS data set, allocate the data set with the value RECFM=V. You should not use RECFM=F because RECFM=F causes the environment variable values to be padded with blanks.