Skip to content

Commit

Permalink
Merge pull request #2547 from leemgs/upstream-systemd-obsapidelayed
Browse files Browse the repository at this point in the history
[dist] Added OBS api delayed service for Systemd
  • Loading branch information
bgeuken committed Feb 16, 2017
2 parents 8b24a4a + 395b288 commit 9caafae
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions dist/systemd/obsapidelayed.service
@@ -0,0 +1,26 @@
[Unit]
Description=OBS API Delayed server
After=network.target

[Service]
EnvironmentFile=/etc/sysconfig/obs-server
ExecStart=/bin/bash -c "/usr/bin/echo -n 'Starting OBS api delayed job handler'"
ExecStart=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=quick start -n 3"
ExecStart=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=releasetracking start -i 1000"
ExecStart=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=issuetracking start -i 1010"
ExecStart=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=mailers start -i 1020"
ExecStart=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb start -i 1030"
ExecStart=/bin/bash -c "/usr/bin/echo -n 'Starting OBS api clock daemon'"
ExecStart=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec /usr/bin/clockworkd --log-dir=log -l -c config/clock.rb start"
ExecStop=/bin/bash -c "/usr/bin/echo -n 'Shutting down OBS api delayed job handler'"
ExecStop=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=quick stop -n 3"
ExecStop=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=releasetracking stop -i 1000"
ExecStop=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=issuetracking stop -i 1010"
ExecStop=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb --queue=mailers stop -i 1020"
ExecStop=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec script/delayed_job.api.rb stop -i 1030"
ExecStop=/bin/bash -c "/usr/bin/echo -n 'Shutting down OBS api clock daemon'"
ExecStop=chroot --userspec=www-data:www-data / /bin/bash -c "cd /srv/www/obs/api && /usr/bin/bundle exec /usr/bin/clockworkd --log-dir=log -l -c config/clock.rb stop"
KillMode=process

[Install]
WantedBy=multi-user.target

0 comments on commit 9caafae

Please sign in to comment.