0

I'm on mac osx using zsh. If I start a rails server with "rails s" I can put it in the background by hitting "ctrl-z" in my terminal (zsh). I can restart it with "fg".

If I open up a different terminal window then I don't see the rails server if I do "jobs". However, I can see it when I do "ps".

Is there a way I can somehow "unpause" the rails server in this new terminal window?

1 Answer 1

2

Yes, find out the process number of the rails process, then send it the continue signal using kill(1).

$> kill -s CONT pid

6
  • Where pid is the process id, obviously. Your kill command might have different syntax, if the above doesn't work, try man kill on your system.
    – uvesten
    May 4, 2011 at 16:09
  • I don't know why but it's not working. I do kill -l to list the commands and I see CONT. So I try kill -CONT 88402 and then I just see a new terminal prompt...nothing seems to happen.
    – Alto
    May 4, 2011 at 23:26
  • You wouldn't see the process' output in the terminal you're sending the continue signal from, it would still go to the terminal that the process was originally attached to.
    – uvesten
    May 5, 2011 at 7:38
  • To be able to attach and detach to processes (and watch their output, etc.) you should be using GNU screen, it's available for almost all unix-like os:es.
    – uvesten
    May 5, 2011 at 7:39
  • @uvesten could I use tmux in the same way as screen?
    – Alto
    May 6, 2011 at 9:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .