[CentOS] Startup script issues

Les Mikesell lesmikesell at gmail.com
Tue Dec 1 16:45:07 UTC 2009


Robert Bielik wrote:
> Brian Mathis skrev:
>> On Tue, Dec 1, 2009 at 8:02 AM, Robert Bielik <robert.bielik at xponaut.se> wrote:
>>> I'm converting Ubuntu startup scripts to work on CentOS (5.3), and I'm having trouble finding out how
>>> to start a daemon in a certain directory? For Ubuntu, start-stop-daemon has the option -d to set the
>>> working directory.
>>>
>>> TIA
>>> /Rob
>> You could "cd" there in the script before starting it.
> 
> Wouldn't that just involve the session which starts the daemon, but not the daemon session itself? Or does
> "daemon" startup the child session within the same working directory ?

Child processes inherit pretty much everything from their parent at the 
time of the fork(), including the working directory.  If they want to 
change, they have to do it afterwards.

-- 
   Les Mikesell
    lesmikesell at gmail.com



More information about the CentOS mailing list