2

I have a shell script as following

#!/bin/sh
screen -d -m -S script1 /usr/bin/ruby script1.rb; true
screen -d -m -S script2 /usr/bin/ruby script2.rb; true
screen -d -m -S script3 /usr/bin/ruby script3.rb; true
screen -d -m -S script4 /usr/bin/ruby script4.rb; true
screen -d -m -S script5 /usr/bin/ruby script5.rb; true
screen -d -m -S script6 /usr/bin/ruby script6.rb; true
screen -d -m -S script7 /usr/bin/ruby script7.rb; true
screen -d -m -S script8 /usr/bin/ruby script8.rb; true
screen -d -m -S script9 /usr/bin/ruby script9.rb; true

No matter of which script run first, only the first eight scripts will get run. How can I solve this problem?

Dante
  • 21
  • 1

2 Answers2

0

You're probably running out of pseudo-tty's. What does it say if you run the first 8 scripts, and then just type "screen" (so that you can see any errors)?

What OS is this? Pseudo-tty allocation is a little different for each, but if you google for "linux (whatever) pseudo tty allocation", it will probably come up.

0

maybe it would be easier to use something like the following template in .screenrc

    # define a bigger scrollback, default is 100 lines
defscrollback 10240

nethack on
startup_message off

hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "

altscreen on


screen bash
title "receiver"

screen bash
title "serv1"

screen bash
title "serv2 "

you can save this screenrc template somewhere and run it as screen -c your_path

Nikolaidis Fotis
  • 2,032
  • 11
  • 13