Thanks, for the advice. The :pty flag fix the problem. I do know that 
the process is not running on the server and it is not buffer related 
before the pty flag.  When this task running, it will consume very high 
cpu load on the server, also the task was never finished.

For some reason, pty solved this problem. When I tried to run on command 
line something like this ( ssh hostname "task name"). I got wierd error:

Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.


Thanks!


Leon Yeh




Jamis Buck wrote:
> If it is long-running, how do you know it is hanging, rather than just
> waiting for the process to complete?
> 
> Some commands, like rake, tend to buffer all output until the command
> is done. I'm not sure why, and I've not had any time to spend
> investigating. Perhaps this command is doing the same, so you aren't
> seeing any of the expected output.
> 
> You might try telling capistrano to allocate a pty for this command:
> 
>   stream "...", :pty => true
> 
> That might work to cause output to not be buffered, but then again, it
> might not. :/
> 
> - Jamis
> 
> On Mon, Sep 29, 2008 at 10:18 PM, Leon Yeh | New Avenue.net
> <[EMAIL PROTECTED]> wrote:
>> Hi Jamis,
>>
>> I have the server setup so that I don't have to entered password for
>> sudo. I tried to replace sudo to use #{sudo} but I got the same result.
>>
>> It has capistrano stuck with this output:
>>  * executing `jail:create_jail_host'
>> user [sysops] :
>> jail_server [chad.newavenue.net] :
>>   * executing "cd /usr/src/; sudo make world DESTDIR=/usr/local/jail/zzz1"
>>     servers: ["zzz.newavenue.net"]
>>     [zzz.newavenue.net] executing command
>>
>>
>> I run the script on Mac and the server is FreeBSD. I run the command on
>> the server, and it run fine. One more thing, this is a very long running
>> process. I am not sure if that is the problem. Most of the example of
>> capitrano task only running short program ( such as cp, scp ..)
>>
>>
>> Thanks
>> Leon Yeh
>>
>>
>>
>>
>> Jamis Buck wrote:
>>> It's the sudo call. Try this instead:
>>>
>>>   stream "cd /usr/src/; #{sudo} make world DESTDIR=#{destdir}"
>>>
>>> In other words, put sudo in #{sudo}, so that capistrano can substitute
>>> the correct sudo invocation. Otherwise, it won't know how to find the
>>> sudo prompt in the output, and thus won't know how to prompt you for
>>> it.
>>>
>>> - Jamis
>>>
>>>
>>> On Mon, Sep 29, 2008 at 9:02 PM, Leon Yeh <[EMAIL PROTECTED]> wrote:
>>>> Hi I have a capistrano that "stream" that in turn running make in the
>>>> remote server.
>>>>
>>>> The code looks like this
>>>> ***********************
>>>>
>>>> desc "Create Jail Host system"
>>>>  task :create_jail_host do
>>>>
>>>>    started_at = connection_info
>>>>    jailname = "chad1"
>>>>    destdir = "/usr/local/jail/" + jailname
>>>>
>>>>    stream "cd /usr/src/; sudo make world DESTDIR=#{destdir}"
>>>> end
>>>>
>>>> **************************
>>>>
>>>> When I run the cap command, it basically hang and when I did ctrl-c
>>>> this is what I see
>>>>
>>>> opt/local/lib/ruby/gems/1.8/gems/capistrano-2.5.0/lib/capistrano/
>>>> processable.rb:25:in `select': Interrupt from
>>>>  /opt/local/lib/ruby/gems/1.8/gems/capistrano-2.5.0/lib/capistrano/
>>>> processable.rb:25:in `process_iteration'
>>>>        from /opt/local/lib/ruby/gems/1.8/gems/capistrano-2.5.0/lib/
>>>> capistrano/command.rb:163:in `process!'
>>>>        from /opt/local/lib/ruby/gems/1.8/gems/capistrano-2.5.0/lib/
>>>> capistrano/command.rb:162:in `loop'
>>>>        from /opt/local/lib/ruby/gems/1.8/gems/capistrano-2.5.0/lib/
>>>> capistrano/command.rb:162:in `process!'
>>>>
>>>>
>>>> Any idea why this create so much problem ?
>>>>
>>>> Thanks in advance
>>>> Leon Yeh
>>>>
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to