Automated Testing

Automated Testing

Automated Testing

Build an automated testing process to enable continuous integration of your hybrid cloud applications including z/OS

 View Only
  • 1.  Execute awsmount in a scheuled cron job

    Posted Sun February 18, 2018 12:11 AM

    I put together a series of steps in a bash script to run a daily backup to an emulated tape.

    Basically, I submit JCL through the external reader, wait a couple seconds then execute an awsmount to load the tape volume and bring it online.

    The issue I'm having is that the awsmount does not want to run within cron.  I can execute my script interactively and it works as expected.

    But, when running as a cron job, I get this error:

    + /usr/z1090/bin/awsmount 580 -m /ibm/z1090/tapes/T00006/usr/z1090/bin/awsmount: error while loading shared libraries: libio_chan.so: cannot open shared object file: No such file or directory

    I've done various things to be sure the file is available, such as making sure the PATH is correct, changing to the bin director where the file is located, but no luck.

    Not sure what else to do from here. 

    Any information would be appreciated.

    Thanks.

    jmal


  • 2.  Re: Execute awsmount in a scheuled cron job

    Posted Tue February 20, 2018 10:03 AM

    The requested function "libio_chan.so" can be reached at "/usr/z1090/bin/".

    Your cron function seems to have been executed under any other user id but ibmsys1. By default, the directory /usr/z1090/bin is included on $PATH variable only for the user id ibmsys1. You should run your job under ibmsys1 or include /usr/z1090/bin in the $PATH variable of this user id. 

     

     

    AdilsonColombo


  • 3.  Re: Execute awsmount in a scheuled cron job

    Posted Wed February 21, 2018 01:51 PM

    Hmmm.. Very strange.  I have the job already running as ibmuser1.  I verified that with an echo in the script.  But, the path didn't include the /usr/z1090/bin in the path, so I updated the path in the script, but the same results.

    I traced the script, with the results below....

    + echo 'Running job as ibmuser1'
    + echo 'Current Path: /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin'
    + PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/z1090/bin
    + echo 'Updated Path: /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/z1090/bin'
    + TAPE=T00000
    + JOB=X
    ++ date +%u
    + DOW=3
    + echo 'Day of Week: 3'
    + '[' 3 -eq 1 ']'
    + '[' 3 -eq 2 ']'
    + '[' 3 -eq 3 ']'
    + TAPE=T00003
    + JOB=bkupwed.jcl
    + '[' 3 -eq 4 ']'
    + '[' 3 -eq 5 ']'
    + '[' 3 -eq 6 ']'
    + '[' 3 -eq 7 ']'
    + echo 'Using Tape: T00003'
    + echo 'Running Job: bkupwed.jcl'
    + echo 'Copying Initialized Tape to Tape Folder'
    + cp /ibm/z1090/tapes/initialized/T00003 /ibm/z1090/tapes
    + echo 'Submitting Job to External Reader'
    + cp /ibm/z1090/jcl/bkupwed.jcl /ibm/z1090/cards
    + echo 'Waiting 30 Seconds for Job to Start'
    + sleep 30s
    + echo 'Mounting Tape on Device'
    + /usr/z1090/bin/awsmount 580 -m /ibm/z1090/tapes/T00003
    /usr/z1090/bin/awsmount: error while loading shared libraries: libio_chan.so: cannot open shared object file: No such file or directory
    + echo 'Waiting 1 Minutes for Job to Complete'
    + sleep 1m
    + echo 'Tape File Information'
    + ls -l /ibm/z1090/tapes/T00003

    jmal


  • 4.  Re: Execute awsmount in a scheuled cron job

    Posted Thu February 22, 2018 09:44 AM

    Working with my Linux guys, it turns out I needed to source the profile of ibmuser1 into my script.

    I added the line

    . ~/.bash_profile

    at the top of my script and that solved my problem.

    Thanks.

    jmal


  • 5.  Re: Execute awsmount in a scheuled cron job

    Posted Mon February 26, 2018 11:10 PM

    Tks for this update.

    AdilsonColombo