Skip to content

Instantly share code, notes, and snippets.

@veprbl
Last active December 14, 2015 16:29
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save veprbl/5115638 to your computer and use it in GitHub Desktop.
Save veprbl/5115638 to your computer and use it in GitHub Desktop.
[Unit]
Description=Gitlab Resque Worker
Requires=redis.service
After=redis.service
Wants=postfix.service mysqld.service
[Service]
Type=forking
User=git
WorkingDirectory=/home/git/gitlab
ExecStart=/bin/sh -c "RAILS_ENV=production bundle exec rake sidekiq:start"
ExecStopPost=/bin/sh -c "RAILS_ENV=production bundle exec rake sidekiq:stop"
PIDFile=/home/git/gitlab/tmp/pids/sidekiq.pid
[Unit]
Description=Self Hosted Git Management
Requires=mysqld.service redis.service
After=mysqld.service redis.service
Wants=postfix.service gitlab-worker.service
[Service]
Type=simple
User=git
WorkingDirectory=/home/git/gitlab
ExecStart=/bin/sh -c "bundle exec unicorn_rails -c /home/git/gitlab/config/unicorn.rb -E production"
PIDFile=/home/git/gitlab/tmp/pids/unicorn.pid
[Install]
WantedBy=multi-user.target
@rriemann
Copy link

rriemann commented Mar 8, 2013

I just did it myself and got nearly the same files like you. I added nginx.service to the wants of gitlab.service.

Furthermore I use unicorn_rails in daemon-mode (-D) and used the service type fork. What's the difference?

Thanks for providing your files! I'm working on a setup based on opensuse 12.1/12.2 64bit.

@veprbl
Copy link
Author

veprbl commented Mar 15, 2013

I'm not sure about daemon-mode. I think it doesn't matter when PIDFile parameter is specified.

I personally use these units on my ArchLinux/i686 and ArchLinuxArm setups.

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