Endevor WSTOMCCS job gets error "Script was NOT run under root"
search cancel

Endevor WSTOMCCS job gets error "Script was NOT run under root"

book

Article ID: 240068

calendar_today

Updated On:

Products

Endevor

Issue/Introduction

Running job WSTOMCCS to deploy or update Endevor Web Services to the Apache Tomcat instance that has to host them.
 
The job fails with error messages about not running as root:
 ÝINFO~ Parameters are loaded from:
        /0103/cai/CSIQ180/ESCM/tpv/ENWSInstallOptions.properties
 §§ Script was NOT run under root (uid=0) and the RUN_AS_ROOT is set to YES.
 §§ Please switch to root (command su), or change RUN_AS_ROOT to NO and run the script again.
 Fri Apr 15 15:30:58 CEST 2022
 ÝINFO~ Log saved in:
        /tmp/WSInstaller-2022-04-15.log
 ================================================================================
                         **** Installation FAILED ****
 ================================================================================

Environment

Release : 18.0

Component : Endevor Software Change Manager

Cause

This error may arise when the ENWSInstallOptions.properties parameter file used by the job specifies RUN_AS_ROOT=YES. In this case, the script executed by the job checks whether it is running under root by parsing the output of 'id' command, which is also echoed to the output.

When 'id' command returns any UID other than uid=0, the error arises and the script fails.

Resolution

As the message text explains, the script needs to be run by root. If it is not run by root, then parameter RUN_AS_ROOT must be set to NO.

If the deployment is done from the Unix shell, in order to run the script as root, it is enough to issue 'su' command before running the deployment script (ENWSIns.sh or ENWSUpd.sh)..

If the development is done in batch by job WSTOMCCS, then step EXPAND needs to be coded as

//*-------------------------------------------------------------------* 
//*         Run the script                                            * 
//*-------------------------------------------------------------------* 
//EXPAND   EXEC PGM=BPXBATCH,REGION=0M,
// PARM='SH su'
//STDIN  DD  PATH='&CCSDPDIR/WSTOMCCS',PATHOPTS=(ORDONLY)
 

The reason is that, when 'su' is issued from BPXBATCH, the command(s) to be executed by 'su'  need to be read from standard input. This is what happens in the above example as BPXBATCH executes  the 'su' command specified in the JCL PARM, which sets the userid to root and then reads and executes the script found in STDIN DD

This behavior is documented in the 'usage notes' of the  IBM description of the 'su' command