commit 7169a52a8b64670c0f53d9301bfc78ac7bc66ec1
parent 30d7a73cb4224ce9ff8d19dd098e1f9e12f4c16c
Author: Yersa Nordman <yersa@finwo.nl>
Date: Thu, 16 Mar 2023 22:20:22 +0100
Include openrc svc files in package
Diffstat:
4 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -34,12 +34,13 @@ $(BIN).1: manpage.1.md
env NAME=$(BIN) envsubst < manpage.1.md | pandoc --standalone --from markdown --to man -o $(BIN).1
env NAME=$(BIN) envsubst < manpage.1.md | pandoc --standalone --from markdown --to html -o $(BIN).html
-.PHONY: package
package: default
+ rm -rf package
mkdir -p package/pmlag
- cp pmlag package/pmlag/pmlag
- cp pmlag.1 package/pmlag/pmlag.1
- cp Makefile.pkg package/pmlag/Makefile
+ cp pmlag package/pmlag/pmlag
+ cp pmlag.1 package/pmlag/pmlag.1
+ cp -r service package/pmlag/service
+ cp Makefile.pkg package/pmlag/Makefile
(cd package ; tar c pmlag | gzip -9 > pmlag-linux-amd64.tar.gz)
.PHONY: clean
diff --git a/Makefile.pkg b/Makefile.pkg
@@ -9,3 +9,8 @@ install: default
install pmlag $(DESTDIR)/bin
install pmlag.1 $(DESTDIR)/share/man/man1
+.PHONY: svc_openrc
+svc_openrc: default
+ DESTDIR=$(DESTDIR) envsubst < ./service/openrc/etc/init.d/pmlag > /etc/init.d/pmlag
+ DESTDIR=$(DESTDIR) envsubst < ./service/openrc/etc/pmlag.ini > /etc/pmlag.ini
+ DESTDIR=$(DESTDIR) envsubst '$$DESTDIR' < ./service/openrc/etc/init.d/pmlag > svc
diff --git a/service/openrc/etc/init.d/pmlag b/service/openrc/etc/init.d/pmlag
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+
+name=$RC_SVCNAME
+command=${DESTDIR}/bin/pmlag
+command_args="-c /etc/pmlag/pmlag.ini"
+pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid"
+command_background="no"
+
+depend() {
+ need net
+}
diff --git a/service/openrc/etc/pmlag.ini b/service/openrc/etc/pmlag.ini
@@ -0,0 +1,8 @@
+; This is an example configuration, showcasing how you might configure multiple types of bonds
+
+; [bond0]
+; interface=eth2
+; interface=eth3
+; hwaddr=eth2
+; hwaddr=56:45:34:23:12:02
+; hwaddr=random