Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Notes / Run ruby app at system startup

Run ruby app at system startup

Sample on FreeBSD:

/etc/rc.conf
local_enable="YES"
/etc/rc.local
su - username -c "cd /home/username &&  . ./rubyapp.sh"
cat /home/username/rubyapp.sh
#!/usr/local/bin/bash
cd /home/username/path/to/app &&  bundle exec unicorn_rails -c config/unicorn.rb -E production -D