[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

shell startup script



Hi, i did it a small shell script to start one service at boot:

#!/bin/bash
   case "$1" in
       start)
           echo "Starting Redmine"
           /etc/init.d/postgresql-8.3 start
           ruby /opt/redmine/script/server -e production &
           echo $! > /tmp/redmine.pid
       ;;
       stop)
           echo "Shutting down Redmine."
           kill -9 `cat /tmp/redmine.pid`
           rm /tmp/redmine.pid
       ;;
       restart)
           $0 stop
           $0 start
       ;;
       *)
           echo "Usage: $0 {start|stop|restart}"
           exit 1
   esac
   exit 0


If i run the command to start the service and close my session, the program stops. How can i make the program ( ruby /opt/redmine/script/server -e production & ) to run even after i close my session? Tks in advance.

--
Leonardo Carneiro


Reply to: