-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide systemd unit file #14
Comments
What OS do you use? |
I'm just one of those crazy damn arch linux users. For what it's worth, RHEL and distros based on it are confirmed to be moving to systemd (replacing upstart and sysvinit) in the future, so might as well get ahead of the game. |
This would be great. Many distros are adopting systemd and apparently the unit files (equivilent of init.d scripts) are pretty easy to write. See: http://fedoraproject.org/wiki/Packaging:Systemd#Unit_Files OSs that currently use systemd:
OSs soon/likely to be moving to / supporting systemd:
Also:
|
gnome 3.6 was just recently released fyi - still no dependency on it that I know of. Another good resource: https://wiki.archlinux.org/index.php/Systemd#Writing_custom_.service_files |
Hi. I got round to doing this so here it is below. Man! Now that I've learnt systemd, it really like it!!
[Unit]
Description=Self Hosted Git Management
Requires=postgresql.service redis.service
After=postgresql.service redis.service
Wants=postfix.service gitlab-worker.service
[Service]
Type=forking
User=gitlab
WorkingDirectory=/home/gitlab/gitlab
ExecStart=/home/gitlab/gitlab/script/rails server -d -e production
PIDFile=/home/gitlab/gitlab/tmp/pids/server.pid
[Install]
WantedBy=multi-user.target
[Unit]
Description=Gitlab Resque Worker
Requires=redis.service
After=redis.service
Wants=postfix.service postgresql.service
[Service]
Type=forking
User=gitlab
WorkingDirectory=/home/gitlab/gitlab
ExecStart=/bin/bash -c '. ~/.bashrc; . ./resque.sh'
ExecStopPost=/usr/bin/rm /home/gitlab/gitlab/tmp/pids/resque_worker.pid
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid |
should note that will only work for gitlab+pgsql installations. perhaps it shouldn't use a wants for postgresql? i imagine, because it is sqlite compatible too, it could just want postgres and mysql, and not require either. |
Yeah I agree, it would be problematic if this were installed indiscriminately. I don't know that there's a way to create a single file that will be solid for sqlite/mysql/postgresql users. This works well for me on postgresql. Maybe if this is installed via script or something then it can substitute or remove with regex? |
@japgolly Looking at the arch wiki, I'd say that just using wants+after would be most appropriate.
So, by moving postgres out of |
I see what you're saying but the problem with that is when people are using postgresql or mysql, it's not optional. For their installations I think people should keep the units the way they are but either change postgresql to mysql or remove it completely if they use sqlite. |
Seeing as sqlite support is being dropped, looks like it'll be postgres/mysql only here. |
updated units |
I provided some service files based on many suggestions that play with Fedora (see above commit). Haven't tested with Arch yet. Feedback welcomed :) |
Would be nice if there was a systemd unit file (for us arch users) along with the init.d script.
If nobody else takes a swing at it, when I get a chance I'll give it a shot. Would be nice too considering that systemd would allow for starting gitlab once redis/resque are up (the proper dependency startup is quite nice)
The text was updated successfully, but these errors were encountered: