Skip to content

Instantly share code, notes, and snippets.

@duderamos
Created January 1, 2017 19:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duderamos/a53bee75212026f8202ec6d5bfb42ba5 to your computer and use it in GitHub Desktop.
Save duderamos/a53bee75212026f8202ec6d5bfb42ba5 to your computer and use it in GitHub Desktop.
Systemd unit file for delayed_job
[Unit]
Description=delayed_job
After=syslog.target
After=postgresql.service
[Service]
Type=forking
User=netengine
Environment=RAILS_ENV=production
WorkingDirectory=/var/www/unicorn/current
ExecStart=/bin/sh -c "/etc/rbenv/shims/ruby /var/www/unicorn/current/script/delayed_job start"
ExecStop=/bin/sh -c "/etc/rbenv/shims/ruby /var/www/unicorn/current/script/delayed_job stop"
TimeoutSec=120
PIDFile=/var/www/unicorn/current/tmp/pids/delayed_job.pid
Restart=always
[Install]
WantedBy=multi-user.target
@Nur-Alam39
Copy link

/etc/rbenv/shims/ruby and /var/www/unicorn/current/script/delayed_job can please describe this two routes?

@duderamos
Copy link
Author

@Nur-Alam39 these are locations of my ruby binary and delayed job script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment