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