aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2017-11-07 11:31:18 +0100
committerFlorian Eckert <fe@dev.tdt.de>2017-11-08 11:36:58 +0100
commit738da3146c63a6c8b151060b0598e400f53a352d (patch)
tree5024f1a7bbe56d6309b23d2116b48459265f3d3f
parentff33ff463b4ddeeb1aea2d4c8147722f8fb3ebcb (diff)
net/keepalived: add keepalived.user script handling
Add keepalived.user script handling which are also saved during sysupgrade. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
-rw-r--r--net/keepalived/Makefile5
-rw-r--r--net/keepalived/files/hotplug-user7
-rw-r--r--net/keepalived/files/keepalived.user14
3 files changed, 26 insertions, 0 deletions
diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile
index ad850511a..b584a3280 100644
--- a/net/keepalived/Makefile
+++ b/net/keepalived/Makefile
@@ -39,6 +39,7 @@ endef
define Package/keepalived/conffiles
/etc/keepalived/keepalived.conf
/etc/config/keepalived
+/etc/keepalived.user
endef
CONFIGURE_ARGS+= \
@@ -62,6 +63,10 @@ define Package/keepalived/install
$(INSTALL_BIN) ./files/keepalived.init $(1)/etc/init.d/keepalived
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/keepalived.config $(1)/etc/config/keepalived
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_CONF) ./files/keepalived.user $(1)/etc/keepalived.user
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/keepalived
+ $(INSTALL_DATA) ./files/hotplug-user $(1)/etc/hotplug.d/keepalived/01-user
endef
$(eval $(call BuildPackage,keepalived))
diff --git a/net/keepalived/files/hotplug-user b/net/keepalived/files/hotplug-user
new file mode 100644
index 000000000..329a8d51b
--- /dev/null
+++ b/net/keepalived/files/hotplug-user
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ -f "/etc/keepalived.user" ] && {
+ /bin/sh /etc/keepalived.user "$@"
+}
+
+exit 0
diff --git a/net/keepalived/files/keepalived.user b/net/keepalived/files/keepalived.user
new file mode 100644
index 000000000..283f53a49
--- /dev/null
+++ b/net/keepalived/files/keepalived.user
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# This file is interpreted as a shell script.
+# The first line of the script must be "#!/bin/sh" without quotes.
+# Lines beginning with # are comments and are not executed.
+#
+# There are three environment arguments that are passed to this script.
+#
+# $TYPE Set to INSTANCE or GROUP, depending on whether keepalived invoked the program from vrrp_instance or vrrp_sync_group.
+# $NAME Set to the name of the vrrp_instance or vrrp_sync_group.
+# $ACTION Set to the end state of the transition.
+# Valid values are:
+# $TYPE==INSTANCE: [ NOTIFY_BACKUP | NOTIFY_MASTER | NOTIFY_FAULT | NOTIFY_STOP | NOTIFY ]
+# $TYPE==GROUP: [ NOTIFY_BACKUP | NOTIFY_MASTER | NOTIFY_FAULT | NOTIFY ]