Password: stty: standard input: Inappropriate ioctl for device

1,319 views
Skip to first unread message

Cyrille

unread,
Aug 18, 2009, 12:34:13 AM8/18/09
to Capistrano
Hi guys,

My deployment works fine from my local machine, but fails from a
different machine (under a different user).

It fails on the first task that uses sudo. Here is the task:

task :after_symlink do
sudo "chown -R #{apache_user} #{release_path}"
end

And the error is:

Password: stty: standard input: Inappropriate ioctl for device

The key difference (I think) is that the deployment runs under the
Apache user (I use Integrity).

Something must be wrong with the stdin for that user, but I can't
quite put my finger on it and I have a low Google fu today...

Suggestions and hints welcome!

Cheers

Cyrille

Cyrille

unread,
Aug 18, 2009, 5:51:57 PM8/18/09
to Capistrano
Hi there,

I've found the source of my problems. It is Capistrano 2.5.8.

The problem: Capistrano 2.5.8 is prompting for the sudo password at
the command line.

The fix: revert to Capistrano 2.5.5!

As a reminder, this is the command I use:

sudo "chown -R #{apache_user} #{release_path}"

My server runs Ubuntu.

I looked at the release notes for Capistrano 2.5.7 and 2.5.8 and I
can't see anything related to sudo...

My problem is solved, but is there a bug or a new *feature* in
Capistrano 2.5.8??

Cyrille

Cyrille

unread,
Aug 18, 2009, 7:29:00 PM8/18/09
to Capistrano
Sorry I got confused there: it has nothing to do with Capistrano 2.5.5
vs 2.5.8.

The fix was actually to use the command:

run "#{sudo} chown ..."

instead of:

sudo "chown ..."

However, Jamis advised in multiple posts to use the sudo helper and it
makes sense to me. So, I'd rather use sudo "chown ..."

I thought I had found a better fix:

http://stackoverflow.com/questions/431925/capistrano-is-hanging-when-prompting-for-sudo-password-to-an-ubuntu-box

But when I tried to add:

default_run_options[:pty] = true

and use the sudo helper, the problem unfortunately re-appeared...

Anyone knows a better fix for this password prompt problem?

Cyrille

Rafael G.

unread,
Aug 19, 2009, 8:21:09 AM8/19/09
to capis...@googlegroups.com
Hi Cyrille,

Sorry for no reply before but theses days are holydays and the
people is gone :-) Could you open a ticket at
https://capistrano.lighthouseapp.com ? we'll see it.

Regards
--
Rafa

Cyrille

unread,
Aug 19, 2009, 9:59:19 PM8/19/09
to Capistrano
Hi Rafael,

thanks for your reply. In New Zealand where I live, it is the middle
of winter :-)

I have no ticket to submit, because all that was wrong was my own
foolishness...

The deployment script was prompting for a password, and that failed
when using Integrity.

What really confused me was that sometimes I would have sudo'ed
(providing the password) on the server (from the cmd line) and thus
the deployment would work for a while...

Anyway, the proper fix (for now) was to allow the deployment user to
sudo without password. Obviously not great from a security
perspective, but it solves my problem.

Cheers

Cyrille

On Aug 20, 12:21 am, "Rafael G." <r...@aspgems.com> wrote:
> Hi Cyrille,
>
>     Sorry for no reply before but theses days are holydays and the
> people is gone :-) Could you open a ticket athttps://capistrano.lighthouseapp.com? we'll see it.
>
> Regards
>
>
>
> Cyrille wrote:
> > Sorry I got confused there: it has nothing to do with Capistrano 2.5.5
> > vs 2.5.8.
>
> > The fix was actually to use the command:
>
> > run "#{sudo} chown ..."
>
> > instead of:
>
> > sudo "chown ..."
>
> > However, Jamis advised in multiple posts to use the sudo helper and it
> > makes sense to me. So, I'd rather use sudo "chown ..."
>
> > I thought I had found a better fix:
>
> >http://stackoverflow.com/questions/431925/capistrano-is-hanging-when-...

Lee Hambley

unread,
Aug 20, 2009, 4:09:12 AM8/20/09
to capis...@googlegroups.com
Cyrille,

Nothing changed in that area, can you provide more output so I can debug it better?

Thanks,

-- Lee Hambley

Twitter: @leehambley
Blog: http://lee.hambley.name/
Working with Rails: http://is.gd/1s5W1


2009/8/18 Cyrille <cbon...@gmail.com>
Reply all
Reply to author
Forward
0 new messages