Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI behavior on Capistrano doesn't seem to be the same as that of an SSH connection. #119

Closed
johnhamelink opened this issue Oct 21, 2011 · 1 comment

Comments

@johnhamelink
Copy link

Hi there,

I'm writing a build script for my node.js application. The node.js instance is governed with forever. From SSH, if I run:

cd /opt/app/current/src && forever start app.js

then run

forever list

I get

[root@symbleBackend src]# forever list
info:   Running action: list
info:   Forever processes running
data:       uid  command script forever pid   logfile                 uptime      
data:   [0] 08Me node    app.js 23287   23288 /root/.forever/08Me.log 0:0:0:5.415 

However, if I use capistrano, the following happens:

puts capture "cd #{deploy_to}/current/src/ && forever start #{node_file}"

then run (from a separate task)

puts capture "forever list"

I get

[root@symbleBackend src]# forever list
info:   Running action: list
info:   No forever processes running

I'm running Capistrano and SSH from the same machine, as the same user, with the same private key.

What reason could there be for this? Surely Capistrano just opens an SSH connection and runs the commands? If so, what difference is there between me using SSH manually and me piping it through Capistrano.

@leehambley
Copy link
Member

@johnhamelink it will be related to the presence of a "pty" or not. Esentially when you log into the machine with SSH two things happen that don't happen with capistrano:

a) you get a "PTY" (this normally indicates to programs that there's an interactive user from whom they could request input)
b) your "dotfiles" are evaluated.

These two things don't happen via capistrano. It can be configured to run with a PTY, but that is ill advised.

mattbrictson pushed a commit to mattbrictson/capistrano that referenced this issue Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants