Skip to content

Commit

Permalink
Move the systemd env var check into the systemd_worker? method
Browse files Browse the repository at this point in the history
When starting a worker we were checking an env var and settings, when
stopping a worker we were just checking settings.  This meant that if
the env var wasn't set we would start the worker with spawn and try to
stop it with systemd which will fail because the unit doesn't exist.
  • Loading branch information
agrare committed Jul 1, 2020
1 parent 90a056c commit b99e4f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/miq_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,15 @@ def containerized_worker?
end

def self.systemd_worker?
MiqEnvironment::Command.supports_systemd? && supports_systemd?
ENV['MIQ_SYSTEMD_WORKERS'] && MiqEnvironment::Command.supports_systemd? && supports_systemd?
end

def systemd_worker?
self.class.systemd_worker?
end

def start_runner
if ENV['MIQ_SYSTEMD_WORKERS'] && systemd_worker?
if systemd_worker?
start_systemd_worker
elsif containerized_worker?
start_runner_via_container
Expand Down
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@
:poll_method: :normal
:starting_timeout: 10.minutes
:stopping_timeout: 10.minutes
:systemd_enabled: true
:systemd_enabled: false
:agent_coordinator_worker:
:heartbeat_timeout: 30.minutes
:poll: 30.seconds
Expand Down

0 comments on commit b99e4f8

Please sign in to comment.