On Fri, Apr 8, 2011 at 4:36 PM, moleculezz <[email protected]> wrote:
> > $ RAILS_ENV=production script/poller run > > Ok, so I did that, but is it normal that I cannot return to the normal > command prompt? > When I do ctrl+z it says: > [1]+ Stopped RAILS_ENV=production script/poller run > > and then it returns to the normal prompt. Does this mean that when > this is running I won't be able to do anything else on the server? > Once you know this is working (ie. the script doesn't exit with an error) you can replace `run` with `start`. That will run the script in the background. > Also, do I have to do this each time if I reboot the server? > You need the script to start on server boot, preferably also have it exit (and remove its PID file) on shutdown. You can use the same command, but pass `stop` to it to have it stop. You'll probably want to manage this through an init script, ie put it inside /etc/init.d and use chkconfig (Redhat/Fedora distros) or update-rc.d (Debian based systems) to start and stop at the relevant runlevels. There are templates for such scripts included in doc/templates- Cheers, - Marius -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected]
