ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

QShell export

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • QShell export

    I'm trying to setup our test systems to access the IBM etc opensource repositories.
    I need the system to go through our companies proxy servers and I need to perform these steps:
    export https_proxy=<our proxy server>
    export http_proxy=<our proxy server>
    export no_proxy=<our company domain>

    When I run these and I try a wget --spider http://public.dhe.ibm.com/software/ibmi/ it works as expected however, if I exit out of QShell and back in again, it no longer works (connection times out) and I have to do the exports again. I'm not sure what's happening as I thought exports were supposed to make things global so can't fathom why the information is not being retained? I have tried this with STRQSH and CALL QP2TERM. I have also tried doing the export command from putty but that is evern more bizarre as it is returning errors such as: https_proxy=<out proxy server> is not an identifier. Even an export -p produces the same error (-p: is not an identifier) which is rather odd.
    Am I doing something obviously silly?

  • #2
    Maybe this is a dumb question but: any reason not to be using ACS for this?

    Cheers,

    Emmanuel

    Comment


    • john.sev99
      john.sev99 commented
      Editing a comment
      There are a plethora of reasons. If I install/update packages via ACS, it runs yum on the server so the proxies need to be set up. Even if this did work, I would still have the issue that if I want to install e.g. a node package by running the install command, this needs to work. At the moment, ACS is not able to retrieve any information on available packages. I'm not sure if this is the cause or not.
      Last edited by john.sev99; August 19, 2020, 03:36 PM.

  • #3
    John,

    When you exit the shell and go back in all of the environment variables will be wiped and restarted.

    There are multiple ways to be sure they get initialized properly every time... but given that this sort of setting is probably something you want to always have set system-wide, I would recommend doing it like this:

    Code:
       ADDENVVAR ENVVAR(https_proxy) VALUE('<our proxy server>') LEVEL(*SYS)
       ADDENVVAR ENVVAR(http_proxy) VALUE('<our proxy server>') LEVEL(*SYS)
       ADDENVVAR ENVVAR(no_proxy) VALUE('<our company domain>') LEVEL(*SYS)
    You will probably need to restart your job (sign off and back on again) before these take effect. But, now they should always be set for you in the native environment, and QShell and PASE should make copies of them when they start up.

    Good luck

    Comment


    • #4
      Thanks Scott. I'm not a unix guru but I thought export made things global but I guess that's not the case. I shall try your suggestions.

      Comment


      • #5
        Originally posted by john.sev99 View Post
        I'm not a unix guru but I thought export made things global but I guess that's not the case.
        Export makes a variable "global" to the current running copy of the shell. So anything launched from that instance of the shell will have the variable. But, if you end the shell and restart it, you start over. Likewise, if you end it and start a different shell, you start over. Separate jobs, of course, have separate copies of their shell so won't have your exported variable, either.

        Using ADDENVVAR LEVEL(*SYS) means that variables in any newly created jobs/shells will be initialized to the value you specify.

        Comment

        Working...
        X