Skip to content

Commit 27b33b4

Browse files
committed
update restart_ssh_service for ACL
Signed-off-by: Mayank Singh <mayankfz@gmail.com>
1 parent 5eee74d commit 27b33b4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

azurelinuxagent/common/osutil/mariner.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
#
1818

1919
from azurelinuxagent.common.osutil.default import DefaultOSUtil
20+
from azurelinuxagent.common.version import DISTRO_FULL_NAME
2021

2122

2223
class MarinerOSUtil(DefaultOSUtil):
2324
def __init__(self):
2425
super(MarinerOSUtil, self).__init__()
2526
self.jit_enabled = True
27+
self.distro_full_name = DISTRO_FULL_NAME
2628

2729
@staticmethod
2830
def get_systemd_unit_file_install_path():
@@ -42,6 +44,10 @@ def restart_if(self, ifname=None, retries=None, wait=None):
4244
self._run_command_without_raising(["systemctl", "restart", "systemd-networkd"])
4345

4446
def restart_ssh_service(self):
47+
# ACL uses sshd.socket for socket-activated SSH (similar to Flatcar/CoreOS).
48+
# Restarting sshd.service would conflict with the active sshd.socket.
49+
if "azure container linux" in self.distro_full_name.lower():
50+
return
4551
self._run_command_without_raising(["systemctl", "restart", "sshd"])
4652

4753
def stop_dhcp_service(self):

0 commit comments

Comments
 (0)