[FFmpeg-devel] [PATCH] Make ffserver child don't chdir just after fork

Måns Rullgård mans
Sat Jun 21 23:38:06 CEST 2008


Baptiste Coudurier <baptiste.coudurier at smartjog.com> writes:

> Hi,
>
> Stefano Sabatini wrote:
>> Hi all,
>> 
>> currently when ffserver runs in daemon mode forks, then the parent
>> exits immediately while the child chdir()s to "/", which is also the dir
>> when it opens its log file, which isn't what the user expects (in most
>> cases it will simply fail to open the file because it doesn't have
>> write permission on that dir).
>> 
>> A possible solution to the problem could be simply not to chdir, but
>> I'm not very familiar with the ffserver.c code so this could be a
>> wrong fix (and maybe we should anyway check for the result of the open
>> operation on the log file).
>
> Humm, yes, patch ok. I don't know why it would chdir to "/".

It's pretty standard procedure for daemons to chdir to /.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list