From e81d1a390fdc958ba789ba69b449112ac6caca0d Mon Sep 17 00:00:00 2001 From: Tata Date: Tue, 23 Apr 2019 17:34:49 +0200 Subject: [PATCH] Add mechanism to reload domain related services (#1710) --- .../files/lib/gluon/reload.d/500-core | 2 ++ package/gluon-core/files/usr/bin/gluon-reload | 17 +++++++++++++++++ .../lib/gluon/reload.d/200-mesh-vpn-fastd-stop | 2 ++ .../lib/gluon/reload.d/800-mesh-vpn-fastd-start | 2 ++ .../reload.d/200-mesh-vpn-tunneldigger-stop | 2 ++ .../reload.d/800-mesh-vpn-tunneldigger-start | 2 ++ .../files/lib/gluon/reload.d/100-respondd-stop | 2 ++ .../files/lib/gluon/reload.d/900-respondd-start | 2 ++ 8 files changed, 31 insertions(+) create mode 100755 package/gluon-core/files/lib/gluon/reload.d/500-core create mode 100755 package/gluon-core/files/usr/bin/gluon-reload create mode 100755 package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/200-mesh-vpn-fastd-stop create mode 100755 package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/800-mesh-vpn-fastd-start create mode 100755 package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/200-mesh-vpn-tunneldigger-stop create mode 100755 package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/800-mesh-vpn-tunneldigger-start create mode 100755 package/gluon-respondd/files/lib/gluon/reload.d/100-respondd-stop create mode 100755 package/gluon-respondd/files/lib/gluon/reload.d/900-respondd-start diff --git a/package/gluon-core/files/lib/gluon/reload.d/500-core b/package/gluon-core/files/lib/gluon/reload.d/500-core new file mode 100755 index 00000000..bc864087 --- /dev/null +++ b/package/gluon-core/files/lib/gluon/reload.d/500-core @@ -0,0 +1,2 @@ +#!/bin/sh +/etc/init.d/network restart diff --git a/package/gluon-core/files/usr/bin/gluon-reload b/package/gluon-core/files/usr/bin/gluon-reload new file mode 100755 index 00000000..805f4201 --- /dev/null +++ b/package/gluon-core/files/usr/bin/gluon-reload @@ -0,0 +1,17 @@ +#!/bin/sh + +cd "/lib/gluon/reload.d" || exit 1 + +err=0 + +for script in *; do + echo "Reloading: ${script}" + ./"$script" || err=1 +done + +if [ $err -eq 1 ]; then + echo 'One or more daemons failed to reload.' >&2 + exit 1 +fi + +exit 0 diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/200-mesh-vpn-fastd-stop b/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/200-mesh-vpn-fastd-stop new file mode 100755 index 00000000..9e860c40 --- /dev/null +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/200-mesh-vpn-fastd-stop @@ -0,0 +1,2 @@ +#!/bin/sh +/etc/init.d/fastd stop diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/800-mesh-vpn-fastd-start b/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/800-mesh-vpn-fastd-start new file mode 100755 index 00000000..e8aad1e6 --- /dev/null +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/800-mesh-vpn-fastd-start @@ -0,0 +1,2 @@ +#!/bin/sh +/etc/init.d/fastd start diff --git a/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/200-mesh-vpn-tunneldigger-stop b/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/200-mesh-vpn-tunneldigger-stop new file mode 100755 index 00000000..651530b2 --- /dev/null +++ b/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/200-mesh-vpn-tunneldigger-stop @@ -0,0 +1,2 @@ +#!/bin/sh +/etc/init.d/tunneldigger stop diff --git a/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/800-mesh-vpn-tunneldigger-start b/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/800-mesh-vpn-tunneldigger-start new file mode 100755 index 00000000..9b174f17 --- /dev/null +++ b/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/800-mesh-vpn-tunneldigger-start @@ -0,0 +1,2 @@ +#!/bin/sh +/etc/init.d/tunneldigger start diff --git a/package/gluon-respondd/files/lib/gluon/reload.d/100-respondd-stop b/package/gluon-respondd/files/lib/gluon/reload.d/100-respondd-stop new file mode 100755 index 00000000..f7283238 --- /dev/null +++ b/package/gluon-respondd/files/lib/gluon/reload.d/100-respondd-stop @@ -0,0 +1,2 @@ +#!/bin/sh +/etc/init.d/gluon-respondd stop diff --git a/package/gluon-respondd/files/lib/gluon/reload.d/900-respondd-start b/package/gluon-respondd/files/lib/gluon/reload.d/900-respondd-start new file mode 100755 index 00000000..3890bd77 --- /dev/null +++ b/package/gluon-respondd/files/lib/gluon/reload.d/900-respondd-start @@ -0,0 +1,2 @@ +#!/bin/sh +/etc/init.d/gluon-respondd start