2

I created an init.d script that launches a system daemon. The daemon uses the system $PATH to launch other processes. The system path, however, does not include "/usr/local/bin" at the time the init.d loads the daemon. So, I have to stop/start the init.d daemon after reboot, which really defeats the purpose of the init.d script!

This question says the init.d script should set the path. PATH issues for init.d scripts on startup

Although this is possible, I'd like a little more flexibility. Is it possible to force the init.d script to load at a runlevel after the system sets the $PATH variable?

tahoar
  • 121
  • 1

1 Answers1

1

It's not that the path is changed during init, rather it's that normal shells get a different environment. See http://www.tldp.org/HOWTO/Path-4.html for an explanation.

Either set the path explicitly at the top of your script or create a new script to set the path and source that at the top of scripts that need the changed environment.

Paul Haldane
  • 4,517
  • 1
  • 21
  • 32