0

I need always running Ruby script at ubuntu 12.04. Now i connect to server at putty and type "ruby execute.rb", but with closing or disconnect console that will stop

If i add "ruby execute.rb" to my ~/.bash_profile - when i connect to server at putty, my window maintain this script and i can't type other commands

So, i want that script works always and starts if system reboot, and i can use any commands in terminal

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user2572790
  • 442
  • 3
  • 13

1 Answers1

0

To run script at system start, you can put your command in /etc/rc.local

# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
ray
  • 4,109
  • 1
  • 17
  • 12
  • I add to rc.local : "cd /var/www/nw;screen -d -m ruby execute.rb" But when i connect via putty and type "screen -r" - i see nothing screens That command work correctly while in ~/.bashprofile, but i need run command at system start (not user connect) – user2572790 Feb 19 '14 at 04:02