0

I'm trying to set the ORACLE_HOME environment variable for my nagios daemon user (it's a nologin user).

I've tried adding a script to export the variable in /etc/profile.d/oracle.sh (the execute bits are also set on this file).

This script sets the environment variable for my own user, but not for the nagios daemon.

1 Answer 1

3

Daemons started via initscripts don't read profile.d/. You'll need to make the initscript source a file from /etc/sysconfig/ that contains the desired value (and then make the profile.d/ script read it from this as well).

7
  • Thanks Ignacio. Could you please be more specific on how to make the initscript source a file from /etc/sysconfig/ ? Sorry! Commented Sep 8, 2010 at 3:01
  • 1
    With the source or . commands. Commented Sep 8, 2010 at 3:03
  • Sorry, do I create a new file in /etc/sysconfig, say called oracle and then reference this file from an initscript. I'm not sure where these initscripts live. do i create a new file somewhere? Thanks for your help! Commented Sep 8, 2010 at 3:12
  • are you refering to /etc/init.d/ Commented Sep 8, 2010 at 3:14
  • 1
    Initscripts do live under /etc/init.d. One of them starts Nagios, probably called nagios. Create a new file in /etc/sysconfig with the variable you want to set and source it within the initscript. Commented Sep 8, 2010 at 3:21

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.