hello i made a little startup script so after a reboot the background processor and delayed job worker are started
#!/bin/bash
# chkconfig: 235 99 10
# description: start or stop
jobsworth
#
### BEGIN INIT INFO
# Provides: jobsworth
# Required-Start: $network $mysqld
$httpd
# Required-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: start or stop
jobsworth
### END INIT INFO
PATH="/usr/local/rvm/gems/ruby-1.9.3-p429/bin:/usr/local/rvm/gems/ruby-1.9.3-p429@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p429/bin:/usr/local/rvm/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/rvm/bin:"
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6)
to ensure that this file is present.
. /lib/lsb/init-functions
#. /etc/init.d/functions
log_daemon_msg() { logger
"$@"; }
log_end_msg() { [ $1 -eq 0 ]
&& RES=OK; logger ${RES:=FAIL}; }
case "$1" in
'start')
log_daemon_msg "Starting Jobsworth Services"
cd /jobsworth/jobsworth-master
RAILS_ENV=production bundle exec script/scheduler.rb restart
echo "start delayed job worker."
RAILS_ENV=production bundle exec script/delayed_job restart
log_end_msg 0
;;
'stop')
log_daemon_msg "Stopping Jobsworth Services"
cd /jobsworth/jobsworth-master
echo "stop the background processor."
RAILS_ENV=production bundle exec script/scheduler.rb stop
echo "stop delayed job worker."
RAILS_ENV=production bundle exec script/delayed_job stop
log_end_msg 0
;;
'restart')
log_daemon_msg "Restarting Jobsworth Services"
cd /jobsworth/jobsworth-master
echo "restart the background processor."
RAILS_ENV=production bundle exec script/scheduler.rb restart
echo "restart delayed job worker."
RAILS_ENV=production bundle exec script/delayed_job restart
log_end_msg 0
;;
'status')
log_daemon_msg "Status Jobsworth Services"
cd /jobsworth/jobsworth-master
echo "status background processor."
RAILS_ENV=production bundle exec script/scheduler.rb status
echo "status delayed job worker."
RAILS_ENV=production bundle exec script/delayed_job status
log_end_msg 0
;;
*)
echo "Usage: $0 {status | start | stop | restart }"
;;
esac
exit 0