5.6 install on Linux – the environment file

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf 5.6 install on Linux – the environment file

  • Creator
    Topic
  • #50066
    Kevin Scantlan
    Participant

    We have installed CL 5.6 with Linux Redhat 5.0.  When trying to run a cron job, the script cannot find CL_INSTALL_DIR  .  I know with 5.6, it’s replacing QUOVADX_INSTALL_DIR.  Should the CL_INSTALL_DIR and FPATH be in the /etc/environment file like it is in AIX?  Should the install script have put it there?  Our does not have that there.  In fact, the file exists but is empty.

    My guess is that I need to add both the CL_INSTALL_DIR and FPATH to that file and reboot the machine for it to take effect.  I checked the documentation, but did not find any reference to that.  Any help would be appreciated.

    Thanks.

Viewing 12 reply threads
  • Author
    Replies
    • #64735
      Robert Kersemakers
      Participant

      Hi Kevin,

      How about executing the cron job under user ‘hci’? This way all settings should be correct.

      So start your cron job with ‘su – hci’ or something similar for Linux.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #64736
      Dirk Engels
      Participant

      When you execute a command in cron on Linux the environment file .cshrc or .profile will not be used. So the environment variables are not set.

      To execute the environment file use bash –login prior to your command. Then the .profile will be executed and your environment should be set.

      Greetings from germany,

      Dirk

    • #64737
      Russ Ross
      Participant

      I have installed QDX 5.6 on AIX 5.3 and here are the lines that the install script added to my /etc/environment file

      Code:

      FPATH=/quovadx/qdx5.6/integrator/kshlib
      CL_INSTALL_DIR=/quovadx/qdx5.6

      I did not have to reboot the server for them to take effect.

      FYI – The install script needs to be run as root to have the necessary privilege to change files like /etc/environment.

      Russ Ross
      RussRoss318@gmail.com

    • #64738
      Tom Patton
      Participant

      I’m going to hijack this thread a little….

      I’m having the same issue w/AIX and the 5.6 install.

      When I run my cron jobs (under hci) I don’t have the QUOVADX_INSTALL_DIR environment variable set.

      I’ve tried adding the export in /hci/quovadx/qdx5.6/integrator/productinfo/defaults and in the .profile but neither of these work for me from my cron jobs.

      I’m using a couple of techniques in the cron scripts e.g.:

      exec $QUOVADX_INSTALL_DIR/integrator/bin/hcitcl “$0″ ${1+”$@”}

      and

      eval `/hci/quovadx/qdx5.3/integrator/sbin/hcisetenv -root ksh $2 $site`

      that give me the following error:

      QUOVADX_INSTALL_DIR is not set. Exit.

      My question is way are your thoughts on the best way to correct this?

      Should I change the code to point to CL_INSTALL_DIR or use another technique to set QUOVADX_INSTALL_DIR?

      Thanks for any thoughts.

    • #64739

      I wold change to CL_INSTALL_DIR.

      -- Max Drown (Infor)

    • #64740
      Kevin Kinnell
      Participant

      Is the default sh in AIX ksh?  IIRC there is a way to start ksh as a login without

      being interactive.  In a GNU/Linux system you’d run bash with the -l to do it, but

      I can’t remember what (or if) it might be in ksh.

      Of course, if I’d just scanned up a little I might have avoided this redundant post.

      –kevin ( props 2 MH, heh) kinnell

    • #64741
      Kevin Scantlan
      Participant

      I placed both the CL_INSTALL_DIR and FPATH variables in the /etc/environment  file, rebooted the machine, created a script just to echo them out, and placed them in cron.  When it runs, it does not have any value for those variables.  Who else runs Linux and what have you done to get cron to recognize (other than having the script have to log into an account).

    • #64742

      For cron jobs, I set up the environment like this:

      ~/.profile.cron

      Code:

      CL_INSTALL_DIR=/hci/quovadx/qdx5.6
      PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.:/usr/local/bin:/usr/local/lib:/usr/local/scripts:${CL_INSTALL_DIR}/integrato
      export PATH
      setroot

      And then in I run the scripts in cron like this:

      Code:

      05 06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,22 * * * . ~/.profile.cron;/hci/bin/monitor/edb_check.tcl sitebn
      05 06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,22 * * * . ~/.profile.cron;/hci/bin/monitor/edb_check.tcl sitebno

      Here’s a portion of the script that demonstrates how to setup the environment in a tcl script:

      Code:

      #!/hci/quovadx/qdx5.6/integrator/bin/tcl

      global HciRoot

      set debug 0

      if { $argc != 1 } {
         puts “Usage: $argv0 siteName”
         exit
      }

      set hostName [exec hostname]
      if {$debug} {puts “hostName: $hostName”}
      set hciSite [lindex $argv 0]
      set date [clock format [clock seconds] -format %Y%m%d]

      # Set up the environment for Cloverleaf commands
      eval [exec $HciRoot/sbin/hcisetenv -root tcl $HciRoot $hciSite]
      set hciDir $HciRoot/$hciSite/scripts/errors

      # Get the number of lines in the error database. Ignore the header and footer (8 lines).
      catch { exec hcidbdump -e | wc -l } lines
      set lines [expr $lines – 8]
      if {$debug} {puts “lines: $lines”}

      -- Max Drown (Infor)

    • #64743
      Kevin Kinnell
      Participant

      We have set up the variables in the hci crontab before we run any

      jobs (5.3 on RHE).  Here’s an example crontab -l:

      Code:

      FPATH=/quovadx/qdx5.3/integrator/kshlib
      HCISITEDIR=/quovadx/qdx5.3/integrator/production
      HCIROOT=/quovadx/qdx5.3/integrator
      HCISITE=production
      TCL_LIBRARY=/quovadx/qdx5.3/integrator/tcl/lib/tcl8.3
      TCLX_LIBRARY=/quovadx/qdx5.3/integrator/tcl/lib/tclX8.2
      QUOVADX_INSTALL_DIR=/quovadx/qdx5.3
      LD_LIBRARY_PATH=/quovadx/qdx5.3/integrator/clgui/java/lib/i386:/quovadx/qdx5.3/integrator/clgui/java/lib/i386/server…

      59 23 * * * /path_to/some_command.tcl

      Ugly, but it works until you figure out a better way.  You can add extra environment

      vars to control what cron does too; in case you want to change the default

      MAILTO for error reports, or whatever else.

      This cron FAQ post at unix.com has some good cron pointers.

    • #64744

      Kevin, I did not know you can do that! That’s VERY good to know.

      -- Max Drown (Infor)

    • #64745
      Yves Guerin
      Participant

      Hello,

      man 5 crontab will explain everything and the variables setting 🙂

    • #64746
      Kevin Kinnell
      Participant

      Max,

      It only works with the crons on Linux AFAIK (unfortunately.)  I think it was

      how Vixie-cron worked, and Anacron et al just copied the behavior because

      Vixie was what everyone was used to.

    • #64747
      Dirk Engels
      Participant

      Hi folks,

      as I wrote before, cron doesn’t read the environment file (or .profile, .bashrc) by default.

      To easily use the standard environment file you’ll have to use the shell command before executing the command:

      Linux:   bash –login

      HP:       ksh -m or -l

      Sun:     tcsh -m

      That let cron read the environment file first before executing the command. I’ve done this on serveral Linux systems and my cron jobs then work normally.

      Dirk

Viewing 12 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10