Created
April 3, 2013 15:09
-
-
Save ahadshafiq/5302058 to your computer and use it in GitHub Desktop.
Rails daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of | |
rails server | |
do: | |
rails s -d | |
then to kill it, find which process is using the port: | |
lsof -i :3000 | |
finally, kill the process: | |
kill -9 $(lsof -i :3000 -t) | |
Create aliases: | |
alias startRails='rails server -d' | |
alias stopRails='kill -9 $(lsof -i :3000 -t)' | |
** extra | |
Find what processes are running: | |
ps aux|grep nameofprogram | |
** run any process as a background job by postfixing the execution command with & | |
user 'jobs' to see whats running in the background | |
then to bring into foreground: fg %1 | |
** some jobs output completion status to screen. Clockwork will be very inteerruptive. | |
To print those putputs to a file instead of the screen: | |
bundle exec clockwork config/clock.rb 2>&1 >>/var/www/applicationname/log/clockwork-output-log & | |
2>&1 >>/pathtologfile & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment