Skip to content

Instantly share code, notes, and snippets.

@TRex22
Created July 16, 2018 08:45
Show Gist options
  • Save TRex22/937538df4d876ff5094644f117d3b884 to your computer and use it in GitHub Desktop.
Save TRex22/937538df4d876ff5094644f117d3b884 to your computer and use it in GitHub Desktop.
Start Rails, Redis and Sidekiq whilst not tying up the console to help with debugging - this is for development use
#!/usr/bin/env sh
echo "Starting Redis-Server in the background ..."
nohup redis-server --save "" --appendonly no > log/redis_server_dev_nohup.log &
echo "Starting Sidekiq in the background ..."
nohup bundle exec sidekiq -C config/sidekiq.yml > log/sidekiq_dev_nohup.log &
nohup bundle exec sidekiq -C config/sidekiq-serial.yml > log/sidekiq_dev_nohup.log &
nohup bundle exec sidekiq -C config/sidekiq-reports.yml > log/sidekiq_dev_nohup.log &
echo "Starting Server ..."
rails server
# stop redis
# redis-server stop # Linux
echo "Shutdown all processes ..."
# If all the child procs are good and listen to the ctrl-c signal
# redis-cli shutdown # mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment