Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2547 from leemgs/upstream-systemd-obsapidelayed
[dist] Added OBS api delayed service for Systemd
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |