From da94cd0c8ba1cb43093d4e47b7eede62cdb53b02 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Tue, 10 Jan 2017 18:00:37 -0500 Subject: [PATCH] systemd job in deploy docs --- doc/production/first-deploy.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/production/first-deploy.md b/doc/production/first-deploy.md index 994e68c2..b6eddd22 100644 --- a/doc/production/first-deploy.md +++ b/doc/production/first-deploy.md @@ -103,7 +103,7 @@ server to see what problems show up: #### Upstart service for delayed_worker: -Put the following code into `/etc/init/metamaps_delayed_worker.conf`: +If your system uses upstart for init scripts, put the following code into `/etc/init/metamaps_delayed_job.conf`: description "Delayed Jobs Worker for Metamaps" @@ -128,3 +128,30 @@ Then start the service and check the last ten lines of the log file to make sure sudo service metamaps_delayed_job start tail /var/log/upstart/metamaps_delayed_job.log + +#### Systemd service for delayed_worker: + +If your system uses systemd for init scripts, ptu the following code into `/etc/systemd/system/metamaps_delayed_job.service`: + + [Unit] + Description=metamaps delayed job service + After=network-online.target + + [Service] + ExecStart=/usr/local/rvm/gems/ruby-2.3.0@metamaps/bin/bundle exec rails jobs:work + WorkingDirectory=/home/metamaps/metamaps + Restart=always + User=metamaps + Group=metamaps + Environment=HOME=/home/metamaps + Environment=PATH="/usr/local/rvm/gems/ruby-2.3.0@metamaps/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/rubies/ruby-2.3.0/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/bin:/bin" + Environment=GEM_PATH="/usr/local/rvm/gems/ruby-2.3.0@metamaps:/usr/local/rvm/gems/ruby-2.3.0@global" + Environment=RAILS_ENV="production" + + [Install] + WantedBy=multi-user.target + +Then start the service and check the last ten lines of the log file to make sure it's running OK: + + sudo systemctl start metamaps_delayed_job + # ??? how the heck do you check systemd logs??