Azure / WALinuxAgent

Microsoft Azure Linux Guest Agent
http://azure.microsoft.com/
Apache License 2.0
541 stars 372 forks source link

Check agent Slice unit property before setting up azure.slice #3196

Closed maddieford closed 3 months ago

maddieford commented 3 months ago

Description

In previous PR we moved setup_azure_slice before checking which slice the agent is in. This resulted in cgroup usage being disabled on first agent update. We should check the agent unit 'Slice' property before setting up azure.slice because the agent's Slice unit property will be 'azure.slice' if the slice drop-in file exists, even though systemd has not moved the agent to azure.slice yet. Systemd will only move the agent to azure.slice after a service restart.

On first agent update (for machines where daemon version did not already create azure.slice), the agent creates azure.slice and the agent unit Slice drop-in file, but systemd does not move the agent unit to azure.slice until service restart. It is ok to enable cgroup usage in this case if agent is running in system.slice.

Issue #


PR information

Quality of Code and Contribution Guidelines