Commit cc3219c8 authored by Balasankar "Balu" C's avatar Balasankar "Balu" C

Move setting of default value for systemd_after to a library from recipe

Signed-off-by: Balasankar "Balu" C's avatarBalasankar "Balu" C <balasankar@gitlab.com>
parent c6257a7b
......@@ -722,11 +722,12 @@ own unit ordering, which is used by AWS Cloudformation.
To fix this, users can make use of `package['systemd_wanted_by']` and
`package['systemd_after']` settings in gitlab.rb to specify values needed for
proper ordering.
proper ordering and run `sudo gitlab-ctl reconfigure`. After reconfigure has
completed, restart `gitlab-runsvdir` service for changes to take effect.
NOTE: **Note:**
This should be done before first reconfigure done (that is, before the unit
files are populated and runsvdir is started).
```
sudo systemctl restart gitlab-runsvdir
```
[certificate link shell script]: https://gitlab.com/snippets/6285
[script source]: https://www.madboa.com/geek/openssl/#verify-new
......
......@@ -23,11 +23,7 @@ default['package']['detect_init'] = true
default['package']['systemd_tasks_max'] = 4915
default['package']['systemd_wanted_by'] = 'multi-user.target'
# Default value for systemd_after is specified in the recipe runit::systemd
# since we want it to be what user has specified for systemd_wanted_by. Do note
# that user setting it explicitly in gitlab.rb will still override the default
# value.
default['package']['systemd_after'] = nil
default['package']['systemd_after'] = 'multi-user.target'
# Setting runit defaults here so that they can be made available automatically
# to cookbooks of individual services via depends in metadata.rb
......
......@@ -40,7 +40,7 @@ module Gitlab
role('consul').use { ConsulRole }
## Attributes directly on the node
attribute('package')
attribute('package').use { Package }
attribute('registry', priority: 20).use { Registry }
attribute('redis', priority: 20).use { Redis }
attribute('postgresql', priority: 20).use { Postgresql }
......
# Copyright:: Copyright (c) 2019 GitLab Inc.
# License:: Apache License, Version 2.0
#
# 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.
#
module Package
class << self
def parse_variables
parse_systemd_variables
end
def parse_systemd_variables
# If user has specified WantedBy but not After, set the latter to the
# former
return unless Gitlab['package']['systemd_wanted_by']
Gitlab['package']['systemd_after'] ||= Gitlab['package']['systemd_wanted_by']
end
end
end
......@@ -23,8 +23,6 @@ directory '/usr/lib/systemd/system' do
recursive true
end
node.default['package']['systemd_after'] = node['package']['systemd_wanted_by']
tasks_max = node['package']['systemd_tasks_max'] if SystemdHelper.systemd_version >= 227
template "/usr/lib/systemd/system/gitlab-runsvdir.service" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment