diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /lib/system_check/incoming_email/mail_room_running_check.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'lib/system_check/incoming_email/mail_room_running_check.rb')
-rw-r--r-- | lib/system_check/incoming_email/mail_room_running_check.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/system_check/incoming_email/mail_room_running_check.rb b/lib/system_check/incoming_email/mail_room_running_check.rb index b7aead4624e..38bb1e46364 100644 --- a/lib/system_check/incoming_email/mail_room_running_check.rb +++ b/lib/system_check/incoming_email/mail_room_running_check.rb @@ -3,12 +3,13 @@ module SystemCheck module IncomingEmail class MailRoomRunningCheck < SystemCheck::BaseCheck + include ::SystemCheck::InitHelpers set_name 'MailRoom running?' def skip? return true if omnibus_gitlab? - unless mail_room_configured? + unless mail_room_enabled? || mail_room_configured? self.skip_reason = "can't check because of previous errors" true end @@ -20,10 +21,10 @@ module SystemCheck def show_error try_fixing_it( - sudo_gitlab('RAILS_ENV=production bin/mail_room start') + 'Start mail_room' ) for_more_information( - see_installation_guide_section('Install Init Script'), + 'doc/administration/incoming_email.md', 'see log/mail_room.log for possible errors' ) fix_and_rerun @@ -31,6 +32,13 @@ module SystemCheck private + def mail_room_enabled? + target = '/usr/local/lib/systemd/system/gitlab.target' + service = '/usr/local/lib/systemd/system/gitlab-mailroom.service' + + File.exist?(target) && File.exist?(service) && systemd_get_wants('gitlab.target').include?("gitlab-mailroom.service") + end + def mail_room_configured? path = '/etc/default/gitlab' File.exist?(path) && File.read(path).include?('mail_room_enabled=true') |