[MPlayer-dev-eng] [HACK] make nohup mplayer/mencoder work

Nicolas George nicolas.george at normalesup.org
Tue Dec 30 11:54:56 CET 2008


Le decadi 10 nivôse, an CCXVII, Reimar Döffinger a écrit :
> it is quite a hack particularly since it introduces a race condition
> (though strictly speaking one exists already in nohup.c anyway, so it
> matter little IMO, which is also the reason I did the check this way).
> Still, it makes nohup work with mencoder/mplayer so it might be worth it
> anyway...

Is it really worth any effort to make nohup work anyway? nohup is crap, I am
amazed that people still advertise its usage. The correct way tu protect a
process from signals sent by the terminal is not to ignore them but to
detach the process from the terminal, which is done by setsid. I would
rather suggest something like that:

diff --git a/DOCS/xml/en/faq.xml b/DOCS/xml/en/faq.xml
index b632558..1bc1338 100644
--- a/DOCS/xml/en/faq.xml
+++ b/DOCS/xml/en/faq.xml
@@ -414,6 +414,17 @@ mplayer <replaceable>options</replaceable> <replaceable>filename</replaceable> &
 </screen>
 </para></answer>
 </qandaentry>
+
+<qandaentry>
+<question><para>
+Why does <application>nohup</application> does not work with
+<application>MPlayer</application>?
+</para></question>
+<answer><para>
+<application>nohup</application> is an ugly hack; the correct way to detach
+a process from its terminal is <application>setsid</application>.
+</para></answer>
+</qandaentry>
 </qandadiv>
 
 <!-- ********** -->

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20081230/0fece762/attachment.pgp>


More information about the MPlayer-dev-eng mailing list