Path: blob/main/filesystems/amazon-efs-utils/files/patch-src_efs__utils__common_proxy.py
46590 views
--- src/efs_utils_common/proxy.py.orig 2026-04-08 20:20:34 UTC1+++ src/efs_utils_common/proxy.py2@@ -286,7 +286,7 @@ def write_stunnel_config_file(3# Only support in stunnel version 5.25+.4global_config["foreground"] = "quiet"56- if any(7+ if sys.platform.startswith("freebsd") or any(8release in system_release_version9for release in SKIP_NO_SO_BINDTODEVICE_RELEASES10):11@@ -586,7 +586,9 @@ def get_init_system(comm_file="/proc/1/comm"):1213def get_init_system(comm_file="/proc/1/comm"):14init_system = DEFAULT_UNKNOWN_VALUE15- if not check_if_platform_is_mac():16+ if sys.platform.startswith("freebsd"):17+ init_system = "rc"18+ elif not check_if_platform_is_mac():19try:20with open(comm_file) as f:21init_system = f.read().strip()22@@ -625,6 +627,25 @@ def start_watchdog(init_system):23if rc != 0:24subprocess.Popen(25["systemctl", "start", WATCHDOG_SERVICE],26+ stdout=subprocess.DEVNULL,27+ stderr=subprocess.DEVNULL,28+ close_fds=True,29+ )30+ else:31+ logging.debug("%s is already running", WATCHDOG_SERVICE)32+33+ elif init_system == "rc":34+ # FreeBSD: use service(8) with onestart/onestatus so the watchdog35+ # runs even when the user hasn't enabled it in rc.conf.36+ rc = subprocess.call(37+ ["/usr/sbin/service", WATCHDOG_SERVICE, "onestatus"],38+ stdout=subprocess.DEVNULL,39+ stderr=subprocess.DEVNULL,40+ close_fds=True,41+ )42+ if rc != 0:43+ subprocess.Popen(44+ ["/usr/sbin/service", WATCHDOG_SERVICE, "onestart"],45stdout=subprocess.DEVNULL,46stderr=subprocess.DEVNULL,47close_fds=True,484950