Author Login
Post Reply
On Mon, Jul 7, 2008 at 7:09 PM, Fabrice Facorat
<fabrice.facorat@(protected):
> 2008/7/7 Vincent Panel <yohonet@(protected)>:
>> Hi,
>>
>> I'm trying to create an initscript for a specific program, but found
>> out the program doesn't have any option to stay in the background. I
>> thought there was such an option for the daemon function used in
>> initscripts, but it seems it doesn't exist. So I tried to put a "&" at
>> the end the program's name in the script without much success.
>>
>> Has any of you already created such an initscript (with a program non
>> forking into the background) ? what did you you do in this case ?
>
> Indeed you are right.
> In this case, you won't be able to use daemon function, and you will
> have to create manually the startup fo the program and add & at the
> end :(
Actually, I solved the problem by rewriting the daemon function,
accepting a new option "--bg" and when this option is provided, I add
an "&" inside the daemon function. I wish this option existed by
default for daemon, programs not forking that you'd like to run as
daemons are not so unusual.