During the boot-up process *nix runs scripts linked into the runlevel directories rc#.d. What I'm wondering is, how do I control the environment that those scripts see? I need to set a couple environment variables, and I can NOT do it from within the scripts because it poses a maintenance nightmare (requiring several very similar site scripts that differ only in their site specific environment).
What I'd like to do is be able to set an environment variable (say $SITE) somewhere before the init script runs so that a single init script can pick up the correct site and execute the daemon process (which requires $SITE to execute).
Any help would be appreciated, and if this is OS specific I'd be nice to know because I have to set it up on both an HP-UX and Linux machine. It looks like much of the init process is similar between the two OSes, but not identical.... Anyway, at least a starting point or idea would be nice.
Thanks!
-- editted for clarity...maybe