From: "Mário Lopes" Date: 2008-06-04T00:51:50+09:00 Subject: Re: Traping signals on child processes ara.t.howard wrote: > On Jun 3, 2008, at 4:07 AM, M�rio Lopes wrote: > >> Which could be the best approach to this issue? Let ffmpeg run in the >> background and trap the INT signals in the foreground? > > i believe this is the case - you cannot inject your own signal > handlers into ffmpeg (easily) so this seems like the easiest solution. > > still i wonder - ffmpeg dies on INT for a reason - it's worth > considering: if a user is running from the console then they expect to > be able to kill a process, if they are not then your problem > vanishes. by trapping INT you will be forcing users to use something > stronger, like -9, which may not do things like clean up temp files, > etc. food for thought. Quite indeed. But it won't be run by a normal user. We just want to make sure that the process doesn't get killed and it gracefully quits and finishes whatever it has to do. I'm currently trying to use the Daemons gem to detach the process and run it in the background. It seems to be working fine lest having to hang on a while cycle and sleep until it ends. No chance of running it concurrently though. -- Posted via http://www.ruby-forum.com/.