# PBSPro environment issues with OOD

**URL:** <https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579>\
**Category:** Get Help\
**Created:** [October 30, 2019, 8:47pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579 "2019-10-30T20:47:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![msgambati-INL](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/msgambati-inl/32/935_2.png) [@msgambati-INL](https://discourse.openondemand.org/u/msgambati-INL)\
**Post date:** [October 30, 2019, 8:47pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579/1 "2019-10-30T20:47:36Z")

</div>

Hello,

We noticed that when we submit jobs through OODs interactive apps that the environment variables PBS\_O\_LOGNAME and PBS\_O\_MAIL are always set to root instead of the correct vaules. We are not sure how to go about changing the environment from where the job is submitted to see if we can fix this is or if this is due to something in OOD.

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![rodgers.355](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rodgers.355/32/193_2.png) [@rodgers.355](https://discourse.openondemand.org/u/rodgers.355)\
**Post date:** [October 31, 2019, 3:16pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579/2 "2019-10-31T15:16:32Z")

</div>

Matt,

Are those variables set correctly when you start a job through the Job Composer?

---

<div class="post-metadata">

**Author:** ![brandon-biggs](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/brandon-biggs/32/350_2.png) [@brandon-biggs](https://discourse.openondemand.org/u/brandon-biggs)\
**Post date:** [October 31, 2019, 10:11pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579/3 "2019-10-31T22:11:00Z")

</div>

Hi,

I work with Matt. The variables are not set correctly when you start a job through the Job Composer. The variables are set to the same incorrect things through job composer and interactive apps.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [November 1, 2019, 9:22pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579/4 "2019-11-01T21:22:52Z")

</div>

I looked up the source code, and we don’t modify that anywhere. All that we’re doing for this functionality is passing in parameters to _send_ (`-m b` or `-m be` for example). We’re not specifying who to send by, so the system is just using the default. And by system I mean `qsub` on the ondemand host. Perhaps there’s a setting missing on that host that’s different from, say a login node where uses submit through ssh?

That said, you can pass environment variables to interactive jobs. This is what that looks like. It’s the `job_environment` attribute under `script`.

```auto
script:
  job_environment:
     PBS_O_MAIL: "cluster-mailer@cluster.org"
     FOO: "bar"

```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![brandon-biggs](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/brandon-biggs/32/350_2.png) [@brandon-biggs](https://discourse.openondemand.org/u/brandon-biggs)\
**Post date:** [November 6, 2019, 6:20pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579/5 "2019-11-06T18:20:26Z")

</div>

We’ll look into that further. Good to know that it doesn’t get modified. Thanks for the feedback. I’ll let y’all know if I have more questions/feedback.

---

<div class="post-metadata">

**Author:** ![rodgers.355](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rodgers.355/32/193_2.png) [@rodgers.355](https://discourse.openondemand.org/u/rodgers.355)\
**Post date:** [November 26, 2019, 4:15pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579/6 "2019-11-26T16:15:31Z")

</div>

Folks,

Apologies for not responding with this idea earlier. This question is essentially a duplicate of [Question About Passing Environment Variables for PBS Job - #2 by rodgers.355](https://discourse.openondemand.org/t/question-about-passing-environment-variables-for-pbs-job/270/2).

The idea is to write a wrapper for `qsub` to SSH to a login node and launch from there. To support that sort of workflow many of OnDemand’s adapters including the one for PBSPro support overriding the default scheduler commands (`qsub`, `qstat`, …) using the `bin_overrides` section of the [PBSPro cluster config](https://osc.github.io/ood-documentation/develop/installation/resource-manager/pbspro.html).

> [@Question About Passing Environment Variables for PBS Job](https://discourse.openondemand.org/t/question-about-passing-environment-variables-for-pbs-job/270/4):
>
> Another option is to use the wrapper script to actually execute the qsub command via `ssh` to a login node. That would ensure you have the same environment as you would when submitting from the login node.
> 
> [This issue](https://github.com/OSC/Open-OnDemand/issues/54) describes a request on how to use `ssh` and the individual who posted the issue actually provided a repo with a [set of wrappers that appear to work for Slurm](https://github.com/puneet336/OOD-1.5_wrappers/tree/master/openondemand/1.5/wrappers/slurm/bin).

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:32pm UTC](https://discourse.openondemand.org/t/pbspro-environment-issues-with-ood/579/7 "2022-05-26T15:32:00Z")

</div>

Closed on May 26, 2022, 3:32pm UTC


