capistrano/capistrano — Issue #119: CLI behavior on Capistrano doesn't seem to be the same as that of an SSH connection.
Author: johnhamelink
Created: 2011-10-21 14:20:31+00:00
State: open

Hi there,

I'm writing a build script for my node.js application. The node.js instance is governed with [forever](https://github.com/indexzero/forever). From SSH, if I run:

```sh
cd /opt/app/current/src && forever start app.js
```
then run

```sh
forever list
```
I get

```bash
[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:

```ruby
puts capture "cd #{deploy_to}/current/src/ && forever start #{node_file}"
```
then run (from a separate task)

```ruby
puts capture "forever list"
```
I get

```bash
[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.