"service"-command and environment variables
Posted
by
varesa
on Server Fault
See other posts from Server Fault
or by varesa
Published on 2012-03-28T13:57:10Z
Indexed on
2012/09/16
21:41 UTC
Read the original article
Hit count: 221
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.
© Server Fault or respective owner