Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/ (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.

share|improve this question
up vote 3 down vote accepted

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).

share|improve this answer
Thanks Ignacio. Could you please be more specific on how to make the initscript source a file from /etc/sysconfig/ ? Sorry! – chickeninabiscuit Sep 8 '10 at 3:01
With the source or . commands. – Ignacio Vazquez-Abrams Sep 8 '10 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! – chickeninabiscuit Sep 8 '10 at 3:12
are you refering to /etc/init.d/ – chickeninabiscuit Sep 8 '10 at 3:14
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. – Ignacio Vazquez-Abrams Sep 8 '10 at 3:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.