cozagent environment variables

General discussion of the Co:Z Toolkit
Post Reply
sdean4
Posts: 25
Joined: Wed Nov 07, 2012 2:05 pm

cozagent environment variables

Post by sdean4 »

I am trying to execute some simple commands on a unix box, from a z/os batch job. I get logged in successfully, but cozagent is unable to find a file. Here is a snippet of the log. libiconv.so.2 is located in /usr/local/lib, which is in the env variable LD_LIBRARY_PATH in the target userid default login script. I have tried using target-env-LD_LIBRARY_PATH, but I still get the same error. Thanks for any assistance...
debug1: Authentication succeeded (publickey).

debug2: fd 4 setting O_NONBLOCK

debug2: fd 5 setting O_NONBLOCK

debug2: fd 6 setting O_NONBLOCK

debug1: channel 0: new client-sessionì

debug3: ssh_session2_open: channel_new: 0

debug2: channel 0: send open

debug1: Entering interactive session.

debug2: callback start

debug2: client_session2_setup: id 0

debug1: Sending command: /apps/adsm/coz/bin/cozagent

debug2: channel 0: request exec confirm 0

debug2: fd 3 setting TCP_NODELAY

debug2: callback done

debug2: channel 0: open confirm rwindow 0 rmax 32768

debug2: channel 0: rcvd adjust 131072
debug2: channel 0: rcvd ext data 80

ld.so.1: cozagent: fatal: libiconv.so.2: open failed: No such file or directory
debug2: channel 0: written 80 to efd 6

debug2: channel 0: rcvd eof

debug2: channel 0: output open -> drain

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0

debug2: channel 0: rcvd close

debug2: channel 0: close_read

debug2: channel 0: input open -> closed

debug3: channel 0: will not send data after close

debug3: channel 0: will not send data after close

debug2: channel 0: obuf empty
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: cozagent environment variables

Post by dovetail »

Sandy,

Your problem is similar to this one: http://dovetail.com/forum/viewtopic.php ... aris#p2235

Somehow, you need to get LD_LIBRARY_PATH set, but using target-env won't work because it is too late.
One option would be to symlink any libraries (like iconv) that you need into one of the default directories in the system LD_LIBRARY_PATH

But here is an alternative that I would suggest:

1) create an executable (chmod 775) script file "cozagent.sh" in the same directory as cozagent

#!/bin/sh
# cozagent.sh - front end to cozagent
DIR=`dirname $0`
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
exec $DIR/cozagent "$@"

2) In COZCFGD, change:
agent-path /apps/adsm/coz/bin/cozagent.sh

3) remove your previous target-env-LD_LIBRARY_PATH setting
sdean4
Posts: 25
Joined: Wed Nov 07, 2012 2:05 pm

Re: cozagent environment variables

Post by sdean4 »

Thank you for your assistance. That got me a little further, but now I am seeing this:
debug1: Authentication succeeded (publickey).
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug2: fd 6 setting O_NONBLOCK
debug1: channel 0: new client-sessionì
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug1: Sending command: /apps/adsm/coz/bin/cozagent.sh -LD,t
debug2: channel 0: request exec confirm 0
debug2: fd 3 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 131072
debug2: channel 0: rcvd ext data 39
cozagentNì: version: 1.1.0 2012-03-16
debug2: channel 0: written 39 to efd 6
debug2: channel 0: rcvd ext data 70
debug2: channel 0: rcvd ext data 68
debug2: channel 0: rcvd ext data 113
debug2: channel 0: rcvd ext data 68
debug2: channel 0: rcvd ext data 58
debug2: channel 0: rcvd ext data 178
debug2: channel 0: rcvd ext data 126
debug2: channel 0: rcvd ext data 178
debug2: channel 0: rcvd ext data 160
debug2: channel 0: rcvd ext data 218
07:56:23.352630ì fromdsn-client(15686)Iì: version: 1.1.0 2012-03-16
07:56:23.353297ì fromdsn-client(15686)Dì: cmd_arg1ì = //DD:STDIN
07:56:23.353407ì fromdsn-client(15686)Dì: Using getaddrinfo() to start connection to server SDV01 at port 8040
07:56:23.353348ì todsn-client(15687)Iì: version: 1.1.0 2012-03-16
07:56:23.353781ì todsn-client(15687)Dì: cmd_arg1ì = -z
07:56:23.353803ì todsn-client(15687)Dì: cmd_arg2ì = //DD:STDOUT
07:56:23.353819ì todsn-client(15687)Dì: Using getaddrinfo() to start connection to server SDV01 at port 8040
07:56:23.355380ì todsn-client(15688)Iì: version: 1.1.0 2012-03-16
07:56:23.355802ì todsn-client(15688)Dì: cmd_arg1ì = -z
07:56:23.355827ì todsn-client(15688)Dì: cmd_arg2ì = //DD:STDERR
07:56:23.355846ì todsn-client(15688)Dì: Using getaddrinfo() to start connection to server SDV01 at port 8040
07:56:23.360897ì todsn-client(15687)Dì: clientCodePage '646' (via setlocale)
07:56:23.360917ì fromdsn-client(15686)Dì: clientCodePage '646' (via setlocale)
07:56:23.361048ì todsn-client(15687)Eì: CoZClient.C(644) - iconv_open(UTF-8, 646) - 22ì Invalid argument
07:56:23.361051ì fromdsn-client(15686)Eì: CoZClient.C(644) - iconv_open(UTF-8, 646) - 22ì Invalid argument
debug2: channel 0: written 1237 to efd 6
debug2: channel 0: rcvd ext data 79
07:56:23.362588ì todsn-client(15688)Dì: clientCodePage '646' (via setlocale)
debug2: channel 0: written 79 to efd 6
cozserver(2)Eì: Unexpected EOF while reading Client_Info packet
cozserver(1)Eì: Unexpected EOF while reading Client_Info packet
cozserver(3)Eì: Unexpected EOF while reading Client_Info packet
debug2: channel 0: rcvd ext data 196
debug2: channel 0: rcvd ext data 86
debug2: channel 0: rcvd ext data 86
debug2: channel 0: rcvd ext data 220
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug2: channel 0: rcvd close
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug3: channel 0: will not send data after close
07:56:23.362847ì todsn-client(15688)Eì: CoZClient.C(644) - iconv_open(UTF-8, 646) - 22ì Invalid argument
07:56:23.362854ì fromdsn-client(15686)Eì: Error: no exit code received from CoZServer
07:56:23.362901ì todsn-client(15687)Eì: Error: no exit code received from CoZServer
07:56:23.364765ì todsn-client(15688)Eì: Error: no exit code received from CoZServer
cozagentEì: Target Program(15685) received signal - 13
cozagentEì: STDERR DD Writer(15688) ended with RC=102
cozagentEì: STDIN DD Reader(15686) ended with RC=102
cozagentEì: STDOUT DD Writer(15687) ended with RC=102
debug2: channel 0: written 588 to efd 6
debug3: channel 0: will not send data after close
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cfd -1)
debug3: channel 0: close_fds r -1 w -1 e 6 c -1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.3 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 105
CoZLauncherEì: adsm@dledm.itg.ti.com target command '<default shell>' ended with RC=105
CoZAgent: adsm@dledm target program '/bin/csh' PID: 15685
CoZAgent: completed with RC=105

I'm not sure which error is actually causing my problem. Any suggestions would be greatly appreciated!
thanks,
Sandy
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Re: cozagent environment variables

Post by coz »

It looks like iconv_open() doesn't like the "646" client code page returned from your current locale. As a test, try adding this to the cozagent.sh script you created earlier:

Code: Select all

COZ_CLIENT_CODEPAGE=ASCII
export COZ_CLIENT_CODEPAGE
And try running again
sdean4
Posts: 25
Joined: Wed Nov 07, 2012 2:05 pm

Re: cozagent environment variables

Post by sdean4 »

Thanks! That seems to have fixed the problem. Although I am still getting these messages:

15:20:26.364432ì todsn-client(28566)Dì: Using getaddrinfo() to start connection to server SDV01 at port 8040
15:20:26.367930ì todsn-client(28565)Dì: clientCodePage 'ASCII' (via COZ_CLIENT_CODEPAGE)
15:20:26.369076ì fromdsn-client(28564)Dì: clientCodePage 'ASCII' (via COZ_CLIENT_CODEPAGE)
15:20:26.370862ì todsn-client(28566)Dì: clientCodePage 'ASCII' (via COZ_CLIENT_CODEPAGE)
debug2: channel 0: written 1134 to efd 6

cozserver(3)Wì: Translator: Unable to initialize iconv. sourceCodePage="ASCII", targetCodePage="IBM-1047"
cozserver(1)Wì: Translator: Unable to initialize iconv. sourceCodePage="ASCII", targetCodePage="IBM-1047"
cozserver(2)Wì: Translator: Unable to initialize iconv. sourceCodePage="ASCII", targetCodePage="IBM-1047"
cozserver(1)Wì: Error creating client codepage (ASCII) translator: TranslateException: Unable initialize Translator,
fallback to iconv failed., RC=121, Reason=-1037303780
cozserver(1)Wì: Client codepage falling back to ISO8859-1
cozserver(2)Wì: Error creating client codepage (ASCII) translator: TranslateException: Unable initialize Translator,
fallback to iconv failed., RC=121, Reason=-1037303780
cozserver(2)Wì: Client codepage falling back to ISO8859-1
cozserver(3)Wì: Error creating client codepage (ASCII) translator: TranslateException: Unable initialize Translator,
fallback to iconv failed., RC=121, Reason=-1037303780
cozserver(3)Wì: Client codepage falling back to ISO8859-1
fromdsn(DD:STDIN)Nì: 2 records/160 bytes read; 13 bytes written in 0 milliseconds.

My test commands run fine (uname -a followed by env)

After the env variables are displayed, I get these 2 messages:

tty: : Invalid argument
tty: : Invalid argument

Other than that it works great.
Sandy
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: cozagent environment variables

Post by dovetail »

Apparently "ASCII" is not a codepage recognized by your platform's iconv() function either.

I suggest you use an appropriate ISO ASCII codepage, like ISO8859-1 (Latin-1 ASCII).
This is recognized, since as you can see from the error messages it is falling back to this when ASCII fails.
Post Reply