diff options
Diffstat (limited to 'lib/system_check/app/systemd_unit_files_or_init_script_exist_check.rb')
-rw-r--r-- | lib/system_check/app/systemd_unit_files_or_init_script_exist_check.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/system_check/app/systemd_unit_files_or_init_script_exist_check.rb b/lib/system_check/app/systemd_unit_files_or_init_script_exist_check.rb new file mode 100644 index 00000000000..b2f059d212b --- /dev/null +++ b/lib/system_check/app/systemd_unit_files_or_init_script_exist_check.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module SystemCheck + module App + class SystemdUnitFilesOrInitScriptExistCheck < SystemCheck::BaseCheck + set_name 'Systemd unit files or init script exist?' + set_skip_reason 'skipped (omnibus-gitlab has neither init script nor systemd units)' + + def skip? + omnibus_gitlab? + end + + def check? + unit_paths = [ + '/usr/local/lib/systemd/system/gitlab-gitaly.service', + '/usr/local/lib/systemd/system/gitlab-mailroom.service', + '/usr/local/lib/systemd/system/gitlab-puma.service', + '/usr/local/lib/systemd/system/gitlab-sidekiq.service', + '/usr/local/lib/systemd/system/gitlab.slice', + '/usr/local/lib/systemd/system/gitlab.target', + '/usr/local/lib/systemd/system/gitlab-workhorse.service' + ] + script_path = '/etc/init.d/gitlab' + + unit_paths.all? { |s| File.exist?(s) } || File.exist?(script_path) + end + + def show_error + try_fixing_it( + 'Install the Service' + ) + for_more_information( + see_installation_guide_section('Install the Service') + ) + fix_and_rerun + end + end + end +end |