aports/community/efs-utils/support-alpine-openrc_1.31.3.patch
Jake Buchholz Göktürk e67ea03d96 community/efs-utils: new aport
New APK for WAS EFS Utils, latest tagged 'release' 1.31.3

Upstream PR to hopefully make the patch here moot: https://github.com/aws/efs-utils/pull/98
2022-03-16 01:12:11 +00:00

58 lines
1.8 KiB
Diff

--- a/src/mount_efs/__init__.py
+++ b/src/mount_efs/__init__.py
@@ -265,7 +265,8 @@
OPEN_SUSE_LEAP_RELEASE_NAME = "openSUSE Leap"
SUSE_RELEASE_NAME = "SUSE Linux Enterprise Server"
MACOS_BIG_SUR_RELEASE = "macOS-11"
-
+ALPINE_RELEASE_NAME = "Alpine Linux"
+
SKIP_NO_LIBWRAP_RELEASES = [
RHEL8_RELEASE_NAME,
CENTOS8_RELEASE_NAME,
@@ -274,6 +275,7 @@
SUSE_RELEASE_NAME,
MACOS_BIG_SUR_RELEASE,
ORACLE_RELEASE_NAME,
+ ALPINE_RELEASE_NAME,
]
# Multiplier for max read ahead buffer size
@@ -1304,6 +1306,11 @@
init_system = f.read().strip()
except IOError:
logging.warning("Unable to read %s", comm_file)
+
+ # OpenRC init system manages services a little differently
+ if init_system == "init" and os.path.isfile("/sbin/openrc"):
+ init_system = "openrc-init"
+ logging.debug("Detected OpenRC init system")
else:
init_system = "launchd"
@@ -1361,6 +1368,24 @@
close_fds=True,
)
elif "start" in str(status):
+ logging.debug("%s is already running", WATCHDOG_SERVICE)
+
+ elif init_system == "openrc-init":
+ proc = subprocess.Popen(
+ ["/sbin/service", WATCHDOG_SERVICE, "status"],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ close_fds=True,
+ )
+ status, _ = proc.communicate()
+ if "stopped" in str(status):
+ subprocess.Popen(
+ ["/sbin/service", WATCHDOG_SERVICE, "start"],
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ close_fds=True,
+ )
+ elif "started" in str(status):
logging.debug("%s is already running", WATCHDOG_SERVICE)
elif init_system == "systemd":