Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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
1  
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
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. –  Ignacio Vazquez-Abrams Sep 8 '10 at 3:21

Your Answer

 
discard

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.