aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Buchholz Göktürk <tomalok@gmail.com>2022-03-16 01:03:45 +0000
committerJake Buchholz Göktürk <tomalok@gmail.com>2022-03-16 01:12:11 +0000
commite67ea03d96e7a8bc68dc4482dfece02d43e5f530 (patch)
tree4173e2b9af2ea833f22d975987b0c2a72c33ce86
parentedcaf831f16df9247d1ca26acc599b4445761ea6 (diff)
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
-rw-r--r--community/efs-utils/APKBUILD35
-rw-r--r--community/efs-utils/amazon-efs-mount-watchdog.initd22
-rw-r--r--community/efs-utils/support-alpine-openrc_1.31.3.patch57
3 files changed, 114 insertions, 0 deletions
diff --git a/community/efs-utils/APKBUILD b/community/efs-utils/APKBUILD
new file mode 100644
index 00000000000..b16a4fbfc0c
--- /dev/null
+++ b/community/efs-utils/APKBUILD
@@ -0,0 +1,35 @@
+# Contributor: Jake Buchholz Göktürk <tomalok@gmail.com>
+# Maintainer: Jake Buchholz Göktürk <tomalok@gmail.com>
+pkgname=efs-utils
+pkgver=1.31.3
+pkgrel=0
+pkgdesc="Utilities for Amazon Elastic File System (EFS)"
+url="https://github.com/aws/efs-utils"
+arch="noarch"
+license="MIT"
+depends="nfs-utils openssl py3-botocore stunnel"
+options="!check"
+source="$pkgname-$pkgver.tar.gz::https://github.com/aws/$pkgname/archive/refs/tags/v$pkgver.tar.gz
+ support-alpine-openrc_$pkgver.patch
+ amazon-efs-mount-watchdog.initd
+"
+subpackages="
+ $pkgname-doc
+ $pkgname-openrc
+"
+
+package() {
+ mkdir -p "$pkgdir"/var/log/amazon/efs
+ install -Dm644 -t "$pkgdir"/etc/amazon/efs dist/efs-utils.conf
+ install -Dm444 -t "$pkgdir"/etc/amazon/efs dist/efs-utils.crt
+ install -Dm755 src/watchdog/__init__.py "$pkgdir"/usr/bin/amazon-efs-mount-watchdog
+ install -Dm755 src/mount_efs/__init__.py "$pkgdir"/sbin/mount.efs
+ install -Dm644 -t "$pkgdir"/usr/share/man/man8 man/mount.efs.8
+ install -Dm755 "$srcdir"/amazon-efs-mount-watchdog.initd "$pkgdir"/etc/init.d/amazon-efs-mount-watchdog
+}
+
+sha512sums="
+79f687fbfc75105ba3f683aecdf074288cbf0500d1de48c6a8c6f2fcf72226a6bd389fa1478f4c88fd145171a9811290c7740f0d64cc44bab4ef6ee111fdd73b efs-utils-1.31.3.tar.gz
+bdac640ebb51f351063b96533a461a331e67695e553bf42c37653fe3b4943df49ae82b10346d597047c3406cfbdcdaef7e0cccbe96a1277b44a07130188b608d support-alpine-openrc_1.31.3.patch
+2fa52d7d722b224cd4e2bad43f0996f1e855321b388c226c4d5c1ecdd7182e7b95d5a930cd19e2df9af061128129a751b69c5cff0f3b95004c2d7fdb5daef795 amazon-efs-mount-watchdog.initd
+"
diff --git a/community/efs-utils/amazon-efs-mount-watchdog.initd b/community/efs-utils/amazon-efs-mount-watchdog.initd
new file mode 100644
index 00000000000..615bc06859e
--- /dev/null
+++ b/community/efs-utils/amazon-efs-mount-watchdog.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+#
+# AWS EFS service script for Alpine Linux
+#
+# See https://wiki.alpinelinux.org/wiki/Writing_Init_Scripts
+# See https://github.com/OpenRC/openrc/blob/master/service-script-guide.md
+# See https://github.com/OpenRC/openrc/blob/master/supervise-daemon-guide.md
+#
+command="/usr/bin/amazon-efs-mount-watchdog"
+command_background=true
+start_stop_daemon_args="-1 /var/log/amazon/efs/mount-watchdog.log -2 /var/log/amazon/efs/mount-watchdog.log"
+pidfile="/var/run/efs.pid"
+supervisor=supervise-daemon
+respawn_delay=15
+respawn_max=1
+respawn_period=15
+
+depend() {
+ need networking
+ use network-online
+ provide amazon-efs-mount-watchdog
+}
diff --git a/community/efs-utils/support-alpine-openrc_1.31.3.patch b/community/efs-utils/support-alpine-openrc_1.31.3.patch
new file mode 100644
index 00000000000..8b5578a7dad
--- /dev/null
+++ b/community/efs-utils/support-alpine-openrc_1.31.3.patch
@@ -0,0 +1,57 @@
+--- 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":