Coder Social home page Coder Social logo

Comments (12)

vsizov avatar vsizov commented on July 19, 2024

What OS do you use?

from gitlab-recipes.

katanacrimson avatar katanacrimson commented on July 19, 2024

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.

from gitlab-recipes.

japgolly avatar japgolly commented on July 19, 2024

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:

  • Arch Linux
  • Fedora 15+
  • Frugalware 1.5+
  • Mageia 2
  • Mandriva 2011+
  • openSUSE 12.1+

OSs soon/likely to be moving to / supporting systemd:

  • Debian
  • Gentoo
  • Red Hat Enterprise Linux 7

Also:

systemd has been proposed as an external dependency of GNOME 3.2 by the project's author.[8] This would essentially require all distributions that use GNOME to use systemd, or at least include it as a configurable option.

from gitlab-recipes.

katanacrimson avatar katanacrimson commented on July 19, 2024

Also:

systemd has been proposed as an external dependency of GNOME 3.2 by the project's author.[8] This would essentially require all distributions that use GNOME to use systemd, or at least include it as a configurable option.

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

from gitlab-recipes.

japgolly avatar japgolly commented on July 19, 2024

Hi. I got round to doing this so here it is below. Man! Now that I've learnt systemd, it really like it!!

/etc/systemd/system/gitlab.service:

[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

/etc/systemd/system/gitlab-worker.service:

[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

from gitlab-recipes.

katanacrimson avatar katanacrimson commented on July 19, 2024

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.

from gitlab-recipes.

japgolly avatar japgolly commented on July 19, 2024

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?

from gitlab-recipes.

katanacrimson avatar katanacrimson commented on July 19, 2024

@japgolly Looking at the arch wiki, I'd say that just using wants+after would be most appropriate.

If the dependency is optional, add Wants=B and After=B instead.

So, by moving postgres out of Requires and into Wants (and keeping it in After) it should allow it to work properly with neither present or with one of the two installed.

from gitlab-recipes.

japgolly avatar japgolly commented on July 19, 2024

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 requires=postgres or requires=mysql is valid and accurate. Like on my installation it shouldn't try to bring up gitlab if postgresql fails.

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.

from gitlab-recipes.

katanacrimson avatar katanacrimson commented on July 19, 2024

Seeing as sqlite support is being dropped, looks like it'll be postgres/mysql only here.

from gitlab-recipes.

veprbl avatar veprbl commented on July 19, 2024

updated units
https://gist.github.com/veprbl/5115638

from gitlab-recipes.

axilleas avatar axilleas commented on July 19, 2024

I provided some service files based on many suggestions that play with Fedora (see above commit). Haven't tested with Arch yet. Feedback welcomed :)

from gitlab-recipes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.