D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Running programs that require a terminal - without one.

 

On Thu, 22 Jun 2006 19:33:20 +0100 (BST)
jody salt <jody_leigh_salt@xxxxxxxxxxx> wrote:

> Hi everyone,
>    
>   Is there anyway on linux of running programs require a terminal -
> without one? 
>   I'm trying to run lame - from a system("command here") function in
> php, to resample mp3s, because I want my website users mp3s to be
> automatically resampled as they upload them. The lame command works
> fine from the command line - but not from a standard system("command
> here") function even with absolute paths. It does seems a bit daft to
> have program like lame doesn't have this ability. 
>   Is there a command that goes something like:
>    
>   pseudo_terminal [your command]

Have you tried screen? If you use the '-d -m' options then it should
launch the screen session in the background. If you start it with a
specific command then it'll exit when it's finished running. So you'll
want something like: 'system("screen -d -m lame $lame_options")'. Also
might be useful to add a name to the screen with the -S option
(something like the users login name?) so you can easily see what's
doing what when you look at the screen list (screen -ls).

Dan

-- 
'Violence is the last refuge of the incompetent'
        Salvor Hardin

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html