diff options
author | Simon Rettberg | 2017-11-23 16:37:01 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-11-23 16:37:01 +0100 |
commit | 31094cb7f6fbf1028a9359aaeeb6ee51b1a31766 (patch) | |
tree | 31f8dfd6e999cf9819d41f6da14d2333b3bdde74 /satellit_installer | |
parent | [SSPS] Update sudo rules (diff) | |
download | setup-scripts-31094cb7f6fbf1028a9359aaeeb6ee51b1a31766.tar.gz setup-scripts-31094cb7f6fbf1028a9359aaeeb6ee51b1a31766.tar.xz setup-scripts-31094cb7f6fbf1028a9359aaeeb6ee51b1a31766.zip |
[SSPS] Add dnbd3 static files
Diffstat (limited to 'satellit_installer')
-rw-r--r-- | satellit_installer/static_files/dnbd3/dnbd3-server.service | 13 | ||||
-rwxr-xr-x | satellit_installer/static_files/dnbd3/is-enabled | 22 | ||||
-rw-r--r-- | satellit_installer/static_files/dnbd3/server.conf | 26 |
3 files changed, 61 insertions, 0 deletions
diff --git a/satellit_installer/static_files/dnbd3/dnbd3-server.service b/satellit_installer/static_files/dnbd3/dnbd3-server.service new file mode 100644 index 0000000..e623e08 --- /dev/null +++ b/satellit_installer/static_files/dnbd3/dnbd3-server.service @@ -0,0 +1,13 @@ +[Unit] +Description=DNBD3 Server +ConditionPathExists=!/srv/openslx/nfs/.notmounted + +[Service] +User=dnbd3 +PermissionsStartOnly=true +ExecStartPre=/opt/openslx/dnbd3/is-enabled +ExecStart=/opt/openslx/dnbd3/dnbd3-server -n +Restart=always +RestartSec=5 +TimeoutStopSec=10 + diff --git a/satellit_installer/static_files/dnbd3/is-enabled b/satellit_installer/static_files/dnbd3/is-enabled new file mode 100755 index 0000000..11d1fb0 --- /dev/null +++ b/satellit_installer/static_files/dnbd3/is-enabled @@ -0,0 +1,22 @@ +#!/bin/sh + +# Run as root! +# Check if dnbd3 is configured active in slx-admin +# If not, stop service and bail out, otherwise exit 0 to +# signal systemd that the daemon should start. +# Retry a couple of times if slx-admin returns +# neither YES nor NO + +for i in 1 2 3 4 END; do + RET=$(curl -m 3 -s 'http://127.0.0.1/slx-admin/api.php?do=dnbd3&get=enabled') + [ "$RET" = "YES" ] && exit 0 + if [ "$RET" = "NO" ]; then + systemctl stop dnbd3-server.service + exit 1 + fi + [ "$i" = "END" ] && break + sleep "$i" +done + +exit 2 + diff --git a/satellit_installer/static_files/dnbd3/server.conf b/satellit_installer/static_files/dnbd3/server.conf new file mode 100644 index 0000000..404e4ff --- /dev/null +++ b/satellit_installer/static_files/dnbd3/server.conf @@ -0,0 +1,26 @@ +[dnbd3] +listenPort=5003 +basePath=/srv/openslx/nfs +serverPenalty=0 +clientPenalty=1000 +isProxy=false +removeMissingImages=true +clientTimeout=15000 +vmdkLegacyMode=true +closeUnusedFd=true + +; Log related config +[logging] +; protip: use SIGUSR2 to reopen log file +; DEACTIVATED +;;file=./dnbd3.log +fileMask=ERROR WARNING MINOR INFO DEBUG1 +consoleMask=ERROR WARNING MINOR INFO +; Valid types (warning: specifying invalid types will not yield an error!) +; ERROR Fatal error, server will terminate +; WARNING Major issue, something is broken but keep running +; MINOR Minor issue, more of a hickup than serious problem +; INFO Informational message +; DEBUG1 Debug information, used for medium verbosity +; DEBUG2 Used for debug messages that would show up a lot + |