summaryrefslogtreecommitdiffstats
path: root/satellit_installer
diff options
context:
space:
mode:
authorChristian Rößler2017-12-06 15:36:18 +0100
committerChristian Rößler2017-12-06 15:36:18 +0100
commit8f57189fabb4657dbdd0ace6e1c5cdc83621d8ad (patch)
tree4e8073aeb58866bb927422f513e54b07989af503 /satellit_installer
parent[SSPS] slxadmin: Update config.php (diff)
downloadsetup-scripts-8f57189fabb4657dbdd0ace6e1c5cdc83621d8ad.tar.gz
setup-scripts-8f57189fabb4657dbdd0ace6e1c5cdc83621d8ad.tar.xz
setup-scripts-8f57189fabb4657dbdd0ace6e1c5cdc83621d8ad.zip
[SSPS] some more stuff, mostly dnbd3
Diffstat (limited to 'satellit_installer')
-rw-r--r--satellit_installer/includes/00-variables.inc2
-rw-r--r--satellit_installer/static_files/dnbd3-server.service13
-rw-r--r--satellit_installer/static_files/dnbd3/rpc.acl2
-rwxr-xr-xsatellit_installer/static_files/is-enabled22
-rw-r--r--satellit_installer/static_files/rpc.acl2
-rw-r--r--satellit_installer/static_files/server.conf26
6 files changed, 66 insertions, 1 deletions
diff --git a/satellit_installer/includes/00-variables.inc b/satellit_installer/includes/00-variables.inc
index f71e370..ce10962 100644
--- a/satellit_installer/includes/00-variables.inc
+++ b/satellit_installer/includes/00-variables.inc
@@ -25,7 +25,7 @@ PACKAGELIST_SERVER="
mysql-server lighttpd atftpd php-cgi php-curl cifs-utils php-mbstring
sudo php-common php-mysqlnd php-cli nfs-kernel-server curl
nfs-common libowfat0 ldap-utils vim gcc make unattended-upgrades gnupg
- libowfat-dev libssl-dev gcc make liblzma-dev tmate php-xml"
+ libowfat-dev libssl-dev gcc make liblzma-dev tmate php-xml net-tools"
"
# Enter here packages needing installation of recommended packages as determines by apt-get:
diff --git a/satellit_installer/static_files/dnbd3-server.service b/satellit_installer/static_files/dnbd3-server.service
new file mode 100644
index 0000000..e623e08
--- /dev/null
+++ b/satellit_installer/static_files/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/rpc.acl b/satellit_installer/static_files/dnbd3/rpc.acl
new file mode 100644
index 0000000..576757c
--- /dev/null
+++ b/satellit_installer/static_files/dnbd3/rpc.acl
@@ -0,0 +1,2 @@
+# Everything from localhost
+127.0.0.0/8 ALL
diff --git a/satellit_installer/static_files/is-enabled b/satellit_installer/static_files/is-enabled
new file mode 100755
index 0000000..11d1fb0
--- /dev/null
+++ b/satellit_installer/static_files/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/rpc.acl b/satellit_installer/static_files/rpc.acl
new file mode 100644
index 0000000..576757c
--- /dev/null
+++ b/satellit_installer/static_files/rpc.acl
@@ -0,0 +1,2 @@
+# Everything from localhost
+127.0.0.0/8 ALL
diff --git a/satellit_installer/static_files/server.conf b/satellit_installer/static_files/server.conf
new file mode 100644
index 0000000..404e4ff
--- /dev/null
+++ b/satellit_installer/static_files/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
+