summaryrefslogtreecommitdiff
path: root/lib/system_check/app/init_script_exists_check.rb
blob: d36dbe7d67dee07ca847c4019fc6f973ceeb06d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module SystemCheck
  module App
    class InitScriptExistsCheck < SystemCheck::BaseCheck
      set_name 'Init script exists?'
      set_skip_reason 'skipped (omnibus-gitlab has no init script)'

      def skip?
        omnibus_gitlab?
      end

      def check?
        script_path = '/etc/init.d/gitlab'
        File.exist?(script_path)
      end

      def show_error
        try_fixing_it(
          'Install the init script'
        )
        for_more_information(
          see_installation_guide_section 'Install Init Script'
        )
        fix_and_rerun
      end
    end
  end
end