From b729857343246adc7da2dad4621e13eb39b1010d Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 25 Aug 2014 11:02:15 +0200 Subject: [PATCH] Add a systemd service for runsvdir --- CHANGELOG | 3 +++ files/gitlab-cookbooks/runit/files/default/gitlab-runsvdir.service | 6 ++++++ files/gitlab-cookbooks/runit/recipes/default.rb | 4 +++- files/gitlab-cookbooks/runit/recipes/systemd.rb | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 files/gitlab-cookbooks/runit/files/default/gitlab-runsvdir.service create mode 100644 files/gitlab-cookbooks/runit/recipes/systemd.rb diff --git a/CHANGELOG b/CHANGELOG index b7e5a48..3eaf44d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,9 @@ The latest version of this file can be found at the master branch of the omnibus-gitlab repository. +7.3.0 +- Add systemd support for Centos 7 + 7.2.0 - Pass environment variables to Unicorn and Sidekiq (Chris Portman) - Add openssl_verify_mode to SMTP email configuration (Dionysius Marquis) diff --git a/files/gitlab-cookbooks/runit/files/default/gitlab-runsvdir.service b/files/gitlab-cookbooks/runit/files/default/gitlab-runsvdir.service new file mode 100644 index 0000000..457fbf2 --- /dev/null +++ b/files/gitlab-cookbooks/runit/files/default/gitlab-runsvdir.service @@ -0,0 +1,6 @@ +[Unit] +Description=GitLab Runit supervision process + +[Service] +ExecStart=/opt/gitlab/embedded/bin/runsvdir-start +Restart=always diff --git a/files/gitlab-cookbooks/runit/recipes/default.rb b/files/gitlab-cookbooks/runit/recipes/default.rb index 43b44aa..eba7473 100644 --- a/files/gitlab-cookbooks/runit/recipes/default.rb +++ b/files/gitlab-cookbooks/runit/recipes/default.rb @@ -33,8 +33,10 @@ when "rhel" else if node['platform_version'] =~ /^5/ include_recipe "runit::sysvinit" - else # >= 6.0 + elsif node['platform_version'] =~ /^6/ include_recipe "runit::upstart" + elsif node['platform_version'] =~ /^7/ + include_recipe "runit::systemd" end end when "fedora" diff --git a/files/gitlab-cookbooks/runit/recipes/systemd.rb b/files/gitlab-cookbooks/runit/recipes/systemd.rb new file mode 100644 index 0000000..d9c26ff --- /dev/null +++ b/files/gitlab-cookbooks/runit/recipes/systemd.rb @@ -0,0 +1,32 @@ +# +# Cookbook Name:: runit +# Recipe:: systemd +# +# Copyright 2014 GitLab B.V. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +link "/etc/systemd/system/default.target.wants/gitlab-runsvdir.service" do + to "/opt/gitlab/embedded/cookbooks/runit/files/default/gitlab-runsvdir.service" + notifies :run, 'execute[systemctl daemon-reload]', :immediately + notifies :run, 'execute[systemctl start gitlab-runsvdir]', :immediately +end + +execute "systemctl daemon-reload" do + action :nothing +end + +execute "systemctl start gitlab-runsvdir" do + action :nothing +end -- libgit2 0.21.2