Если ваш монитор работает как root и вы хотите запустить delayed_job как my_user , то сделайте следующее:
/ и т.д. / init.d / delayed_job
#!/bin/sh
# chmod 755 /etc/init.d/delayed_job
# chown root:root /etc/init.d/delayed_job
case "$1" in
start|stop|restart)
DJ_CMD=$1
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit
esac
su -c "cd /var/www/my_app/current && /usr/bin/env bin/delayed_job $DJ_CMD" - my_user
/ вар / WWW / my_app / Shared / монит / delayed_job.monitrc
check process delayed_job with pidfile /var/www/my_app/shared/tmp/pids/delayed_job.pid
start program = "/etc/init.d/delayed_job start"
stop program = "/etc/init.d/delayed_job stop"
if 5 restarts within 5 cycles then timeout
/ и т.д. / монит / monitrc
# add at bottom
include /var/www/my_app/shared/monit/*