[vdr] [RFC] Shutdown rewrite for 1.5.x

Marko Mäkelä marko.makela at hut.fi
Wed Jan 24 12:34:27 CET 2007


On Tue, Jan 23, 2007 at 10:19:57PM +0100, Udo Richter wrote:
> Since the shutdown script runs in the background, the stdin could 
> probably be closed. After all, VDR should continue to 'own' stdin, and 
> running in the background would probably cause a conflict. However, 
> running the script with a closed file handle may cause other side effects.

I can't think of any side effect.  The shutdown script is not supposed
to be interactive, and system tools generally do not read stdin.

There are two reasons why my runvdr script closes stdin and redirects
stdout and stderr to a file.  First, scrolling console output on the bitmap
framebuffer could interfere with softdevice-dfb or slow down the playback.
Second, I may occasionally launch the runvdr script via an ssh session,
and the ssh session would refuse to close if stdin, stdout, or stderr are
being used after exiting the shell.

I guess I could work around this bug by leaving file descriptor 0 open
before starting vdr, e.g., by replacing the <&- with </dev/null in my
runvdr script.  But I would very much appreciate it if you could add
close(STDIN_FILENO) after the fork() call.

Are you planning to maintain the 1.4 branch of the patch?  If yes
(and I hope so), can plugins use some #ifdef to see if
Shutdown.IsUserInactive() is available?

	Marko



More information about the vdr mailing list