-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agentless #1289
Agentless #1289
Changes from 6 commits
ed541e2
aabdd08
896e911
4bcba0d
9a644fe
588edd3
f194c7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,17 @@ def check_pid(self): | |
|
||
fileutil.write_file(pid_file, ustr(os.getpid())) | ||
|
||
def sleep_if_disabled(self): | ||
agent_disabled_file_path = conf.get_disable_agent_file_path() | ||
if os.path.exists(agent_disabled_file_path): | ||
import threading | ||
logger.warn("Disabling the guest agent by sleeping forever; " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no API to disable the agent, there's just a file on disk? I assumed we would just stop the service, and no code would be running. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The API is in CRP, exposed through ARM/SDK/CLI. Cloud-init will honor this flag by stopping/disabling the service, but for distros without cloud-init support, I believe this is the best we can do. |
||
"to re-enable, remove {0} and restart" | ||
.format(agent_disabled_file_path)) | ||
self.running = False | ||
disable_event = threading.Event() | ||
disable_event.wait() | ||
|
||
def initialize_environment(self): | ||
# Create lib dir | ||
if not os.path.isdir(conf.get_lib_dir()): | ||
|
@@ -149,5 +160,7 @@ def daemon(self, child_args=None): | |
else: | ||
logger.info("RDMA capabilities are not enabled, skipping") | ||
|
||
self.sleep_if_disabled() | ||
|
||
while self.running: | ||
self.update_handler.run_latest(child_args=child_args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this to the various waagent.conf versions in the tree. I think people are more likely to read that file than they are the web site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated