"service"-command and environment variables
- by varesa
I am trying to start a service that requires a env. variable to be set to certain path. I set this variable in "/etc/profile.d/". However when I start this service using the service command, it doesn't work.
man service:
service runs a System V init script in as predictable environment as possible,
removing most environment variables and with current working directory set to /.
So it seems that service is removing my variables. How should I set the variables up to keep them from being removed. Or is that something i should not do.
I could start the service manually using the init-scripts, or even hardcode the path into the script, but I'd like to know how to use it with the service command.