summaryrefslogtreecommitdiffstats
path: root/core/modules/dnbd3-proxy-mode
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/dnbd3-proxy-mode')
-rwxr-xr-xcore/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy24
-rw-r--r--core/modules/dnbd3-proxy-mode/module.build4
2 files changed, 26 insertions, 2 deletions
diff --git a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy
index e45272a6..771bc707 100755
--- a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy
+++ b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy
@@ -283,6 +283,30 @@ if [ -n "$islocal" ]; then
adduser dnbd3 fuse
# Start service, is not symlinked when not in proxy mode
systemctl --no-block start dnbd3-proxy.service
+ (
+ # give it some time to start
+ usleep 500000
+ for i in 1 2 3 4 5 ""; do
+ [ -z "$i" ] && exit 1
+ if echo | busybox timeout 1 busybox nc 127.0.0.1 "$DNBD3_PORT"; then
+ break
+ fi
+ echo "fail #$i"
+ sleep 1
+ done
+
+ # it's up, so let's try to add the server
+ if ! dnbd3-client -A 127.0.0.1 -d /dev/dnbd0; then
+ # failed, either the dnbd3-client doesn't support -A or
+ # it is still not up.
+ exit 1
+ fi
+
+ if ! dnbd3-client -s 127.0.0.1 -d /dev/dnbd0; then
+ # localhost still not found even though its in alt-servers !?
+ exit 1337
+ fi
+ ) &
fi
exit 0
diff --git a/core/modules/dnbd3-proxy-mode/module.build b/core/modules/dnbd3-proxy-mode/module.build
index a2c0bd22..4ab661f9 100644
--- a/core/modules/dnbd3-proxy-mode/module.build
+++ b/core/modules/dnbd3-proxy-mode/module.build
@@ -8,6 +8,6 @@ build() {
}
post_copy() {
- add_group "dnbd3"
- USER="dnbd3" GROUP="dnbd3" add_user
+ add_system_group "dnbd3"
+ USER="dnbd3" GROUP="dnbd3" add_system_user
}