CA Workload Automation ESP Edition

Expand all | Collapse all

LINUX login confusion    logname: no login name  in spool   Why ??

Jump to Best Answer
  • 1.  LINUX login confusion    logname: no login name  in spool   Why ??

    Posted 10-11-2010 04:40 PM
    I have a couple of ESP Linux distributed agents. They seem to work just fine. However when I view the spool I always find there is a line or two of of output right before the expected spool. Sometimes I see the below

    logname: no login name
    /etc/profile[67]: [: argument expected      

    and sometimes I only see

    logname: no login name

    and these lines show up before the expected spool whether user is a local account on the box or not. I am a mainframer and am quite confused because I have never encountered this problem on any of my AIX agents.

    I ran a test job to verify what my logname was and it turned out to be the same value I specified as user in the LINUX_JOB definition. Has anyone else seen this particular behavior. Thanks in advance. I am going to paste in my test application and the spool it generates which lists the environmental variables associated with my userid

    APPL LINUXJOB
    LINUX_JOB TESTLINX
    AGENT LDXWAS65
    USER me24948
    CMDNAME /usr/bin/ksh
    ARGS -c "env"
    EXITCODE 0 SUCCESS
    RUN ANY
    ENDJOB

    ----------------------------------------------- Row 1 of 52, Col 1 -
    COMMAND ===>
    ---------------------------------- TOP OF DATA---------------------------------
    ----------------------------------------------------------------
    Output of messages for workload object TESTLINX/LINUXJOB.1/MAIN
    Start date Tue Oct 5 15:03:23 2010
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    Output of messages for workload object TESTLINX/LINUXJOB.1/MAIN
    Start date Tue Oct 5 15:07:10 2010
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    Output of messages for workload object TESTLINX/LINUXJOB.1/MAIN
    Start date Tue Oct 5 15:50:41 2010
    ----------------------------------------------------------------
    logname: no login name
    /etc/profile[67]: [: argument expected                                        
    _=/bin/env
    CONSOLE=/dev/console
    ESPAGENT=LDXWAS65
    ESPAGENTDIR=/opt/esp
    ESPAGENTHASH=DE6C849833B91D486BE58559E94FEB56608159A8
    ESPAGENTPORT=3015
    ESPAPGEN=1
    ESPAPPL=LINUXJOB
    ESPAPPLMGR=JavaAgent#tcpip@CENTER2
    ESPMSGQUEUE=/opt/esp/cybAgent.bin
    ESPOBJECT=TESTLINX/LINUXJOB.1/MAIN
    ESPWOB=TESTLINX
    G_BROKEN_FILENAMES=1
    HISTSIZE=1000
    HOME=/home/me24948
    HOSTNAME=ldxwas65.dx.deere.com
    INIT_VERSION=sysvinit-2.86
    INPUTRC=/etc/inputrc
    LANG=en_US.UTF-8
    LD_LIBRARY_PATH=/opt/esp:/opt/esp:/opt/esp/jre/lib/i386:/opt/esp/jre/lib/i386/s
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    LOGNAME=me24948
    LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;
    MAIL=/var/spool/mail/me24948
    NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
    PATH=/usr/kerberos/bin:/sbin:/usr/sbin:/bin:/usr/bin
    PREVLEVEL=N
    PWD=/opt/esp
    RUNLEVEL=3
    SELINUX_INIT=YES
    SHELL=/bin/ksh
    SHLVL=1
    TERM=linux
    USER=me24948
    XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
    previous=N
    runlevel=3

    Thank you very much


  • 2.  RE: LINUX login confusion logname: no login name in spool Why ??
    Best Answer

    Posted 10-12-2010 09:38 AM
    Can you update you test job as follows to list the contents of /etc/profile.

    [font=Courier New]APPL LINUXJOB
    LINUX_JOB TESTLINX
    AGENT LDXWAS65
    USER me24948
    CMDNAME /usr/bin/ksh
    [color=#0000FF]ARGS -c "nl /etc/profile"[color]
    EXITCODE 0 SUCCESS
    RUN ANY
    ENDJOB [font]


  • 3.  RE: LINUX login confusion logname: no login name in spool Why ??

    Posted 10-12-2010 01:27 PM
    I have done as you asked. See below. Thank you ever so much.

    ----------------------------------------------------------------
    OUTPUT OF MESSAGES FOR WORKLOAD OBJECT TESTLINX.GETDOC/LINUXJOB.1/MAIN
    START DATE TUE OCT 12 12:19:15 2010
    ----------------------------------------------------------------
    LOGNAME: NO LOGIN NAME
    /ETC/PROFILE[67]: [: ARGUMENT EXPECTED
    1@# /ETC/PROFILE

    2@# SYSTEM WIDE ENVIRONMENT AND STARTUP PROGRAMS, FOR LOGIN SETUP
    3@# FUNCTIONS AND ALIASES GO IN /ETC/BASHRC

    4@PATHMUNGE () {
    5@@IF ! ECHO $PATH | /BIN/EGREP -Q "(¬|:)$1($|:)" ; THEN
    6@@ IF [ "$2" = "AFTER" ] ; THEN
    7@@ PATH=$PATH:$1
    8@@ ELSE
    9@@ PATH=$1:$PATH
    10@@ FI
    11@@FI
    12@}

    13@# KSH WORKAROUND
    14@IF [ -Z "$EUID" -A -X /USR/BIN/ID ]; THEN
    15@@EUID=`ID -U`
    16@@UID=`ID -RU`
    17@FI

    18@# PATH MANIPULATION
    19@IF [ "$EUID" = "0" ]; THEN
    20@@PATHMUNGE /SBIN
    21@@PATHMUNGE /USR/SBIN
    22@@PATHMUNGE /USR/LOCAL/SBIN
    23@FI

    24@# NO CORE FILES BY DEFAULT
    25@ULIMIT -S -C 0 > /DEV/NULL 2>&1

    26@IF [ -X /USR/BIN/ID ]; THEN
    27@@USER="`ID -UN`"
    28@@LOGNAME=$USER
    29@@MAIL="/VAR/SPOOL/MAIL/$USER"
    30@FI

    31@HOSTNAME=`/BIN/HOSTNAME`
    32@HISTSIZE=1000

    33@IF [ -Z "$INPUTRC" -A ! -F "$HOME/.INPUTRC" ]; THEN
    34@ INPUTRC=/ETC/INPUTRC
    35@FI

    36@EXPORT PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

    37@FOR I IN /ETC/PROFILE.D/*.SH ; DO
    38@ IF [ -R "$I" ]; THEN
    39@ IF [ "$PS1" ]; THEN
    40@ . $I
    41@ ELSE
    42@ . $I >/DEV/NULL 2>&1
    43@ FI
    44@ FI
    45@DONE

    46@UNSET I
    47@UNSET PATHMUNGE
    48@### HISTFILE SETUP FOR ROOT
    49@IF [ $LOGNAME = ROOT ];THEN
    50@ IF [  -S "/USR/LOCAL/SCRIPTS/DATA/HISTFILE" ];THEN
    51@ . /USR/LOCAL/SCRIPTS/DATA/HISTFILE
    52@ FI
    53@FI
    54@###
    55@LOGNAME=`LOGNAME`
    56@IF [ $LOGNAME != ROOT ] && [ -S "/USR/LOCAL/SCRIPTS/DATA/GLOBAL.ENV" ];THEN
    57@ #ECHO "SOURCING GLOBAL ENVIRONMENT"
    58@ . /USR/LOCAL/SCRIPTS/DATA/GLOBAL.ENV
    59@FI