Skip to content

Commit

Permalink
acu70920 avoided using agent_watcher in the Windows case because our …
Browse files Browse the repository at this point in the history
…Windows service already provides this behavior externally
  • Loading branch information
smessier committed Jan 28, 2013
1 parent 141f1d0 commit 34d0893
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 6 additions & 2 deletions scripts/agent_checker.rb
Expand Up @@ -203,11 +203,15 @@ def start(options)
end
end

# note that our Windows service monitors rnac and rchk processes
# externally and restarts them if they die, so no need to roll our
# own cross-monitoring on that platform.
use_agent_watcher = !RightScale::Platform.windows?
EM.run do
check
setup_agent_watcher
setup_agent_watcher if use_agent_watcher
end
stop_agent_watcher
stop_agent_watcher if use_agent_watcher

rescue SystemExit => e
raise e
Expand Down
16 changes: 11 additions & 5 deletions scripts/agent_controller.rb
Expand Up @@ -185,12 +185,18 @@ def run_command(message, command)
# === Return
# true:: Always return true
def start_agent(agent_name, agent_class = Agent)
agent_watcher = AgentWatcher.new( lambda { |s| Log.info(s) }, @options[:pid_dir] )
agent_watcher.watch_agent("#{@options[:identity]}-rchk", '/opt/rightscale/bin/rchk', '--start', '--stop')
@options[:ready_callback] = Proc.new { agent_watcher.start_watching() }

# note that our Windows service monitors rnac and rchk processes
# externally and restarts them if they die, so no need to roll our
# own cross-monitoring on that platform.
use_agent_watcher = !RightScale::Platform.windows?
agent_watcher = nil
if use_agent_watcher
agent_watcher = AgentWatcher.new( lambda { |s| Log.info(s) }, @options[:pid_dir] )
agent_watcher.watch_agent("#{@options[:identity]}-rchk", '/opt/rightscale/bin/rchk', '--start', '--stop')
@options[:ready_callback] = Proc.new { agent_watcher.start_watching() }
end
super
agent_watcher.stop_watching()
agent_watcher.stop_watching if use_agent_watcher
end

# Determine syslog program name based on options
Expand Down

1 comment on commit 34d0893

@flexera-ci
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RS-COMPLIANCE: COMPLIANCE-COMMITMESSAGE-PASS Build: #5852(2013-01-28_18-18-32), repo: right_link, branch: teal_13_01_acu69367_remove_monit_dependency, sha: 34d0893, status: PASS, reason: Contains acu string

Please sign in to comment.