summaryrefslogtreecommitdiffstats
path: root/satellit_installer
diff options
context:
space:
mode:
authorSimon Rettberg2018-04-19 17:27:29 +0200
committerSimon Rettberg2018-04-19 17:27:29 +0200
commita1f380fabd251e62df0139cd9f61b75c6477ac8b (patch)
treea0c3b2a2e10d17d9932027d55d408c81c310b7f9 /satellit_installer
parent[SSUS] added permissionmanager to slxadmin module link list (diff)
downloadsetup-scripts-a1f380fabd251e62df0139cd9f61b75c6477ac8b.tar.gz
setup-scripts-a1f380fabd251e62df0139cd9f61b75c6477ac8b.tar.xz
setup-scripts-a1f380fabd251e62df0139cd9f61b75c6477ac8b.zip
[SSPS] Kill dup files; move tftpd files around
Diffstat (limited to 'satellit_installer')
-rw-r--r--satellit_installer/includes/10-configurations.inc15
-rw-r--r--satellit_installer/includes/50-install_dnbd3-server.inc25
-rw-r--r--satellit_installer/static_files/dnbd3-server.service13
-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
-rw-r--r--satellit_installer/static_files/tftpd/tftpd-hpa6
-rw-r--r--satellit_installer/static_files/tftpd/tftpd-hpa.service (renamed from satellit_installer/static_files/tftpd-hpa.service)0
8 files changed, 23 insertions, 86 deletions
diff --git a/satellit_installer/includes/10-configurations.inc b/satellit_installer/includes/10-configurations.inc
index 0ab68f8..7ea5355 100644
--- a/satellit_installer/includes/10-configurations.inc
+++ b/satellit_installer/includes/10-configurations.inc
@@ -3,15 +3,8 @@ patch_tftpd-hpa_config() {
[ "$SYSTEMD" ] && systemctl stop tftpd-hpa || /etc/init.d/tftpd-hpa stop 2>/dev/null 1>&2
echo "ok."
# No sense in patching, we will drop this little entry.
- echo -n "# Patching tftpd-hpa configuration... "
- cat <<- HEREDOC > /etc/default/tftpd-hpa
- # /etc/default/tftpd-hpa
- TFTP_USERNAME="tftp"
- TFTP_DIRECTORY="/srv/openslx/tftp"
- TFTP_ADDRESS="0.0.0.0:69"
- TFTP_OPTIONS="--secure"
- HEREDOC
- echo "ok."
+ echo "# Patching tftpd-hpa configuration... "
+ cp -p "$BASEDIR/static_files/tftpd/tftpd-hpa" "/etc/default/tftpd-hpa" || perror "failed"
# sometimes a tftp stating line remains in /etc/inetd.conf. Let's have a look and kill this interesting line:
echo -n "# Checking /etc/inetd.conf for a tftp entry... "
if [ -f /etc/inetd.conf ]; then
@@ -28,8 +21,8 @@ patch_tftpd-hpa_config() {
}
copy_tftpd-hpa_service() {
- echo -n "# Copying tftpd-hpa service file... "
- cp -p "$BASEDIR/static_files/tftpd-hpa.service" /etc/systemd/system && echo "ok." || perror "failed."
+ echo "# Copying tftpd-hpa service file... "
+ cp -p "$BASEDIR/static_files/tftpd/tftpd-hpa.service" "/etc/systemd/system/tftpd-hpa.service" || perror "failed"
echo -n "# Linking tftpd-hpa service file into (/etc/systemd/system/)multi-user.target.wants... "
ln -s ../tftpd-hpa.service /etc/systemd/system/multi-user.target.wants/tftpd-hpa.service \
&& echo "ok." || perror "Could not link tftpd-hpa service file into multiuser target!"
diff --git a/satellit_installer/includes/50-install_dnbd3-server.inc b/satellit_installer/includes/50-install_dnbd3-server.inc
index ef0aafd..129242b 100644
--- a/satellit_installer/includes/50-install_dnbd3-server.inc
+++ b/satellit_installer/includes/50-install_dnbd3-server.inc
@@ -1,28 +1,29 @@
install_dnbd3-server_service() {
- echo -n " copying dnbd3-server service file... "
- cp -p "$BASEDIR/static_files/dnbd3-server.service" /etc/systemd/system && echo "ok." || perror "failed."
- echo -n "# Linking dnbd3-server service file into (/etc/systemd/system/)multi-user.target.wants... "
- ln -s /etc/systemd/system/dnbd3-server.service /etc/systemd/system/multi-user.target.wants/dnbd3-server.service \
- && echo "ok." || perror "Could not link dnbd3-server service file into multiuser target!"
+ echo "# copying dnbd3-server service file..."
+ cp -p "$BASEDIR/static_files/dnbd3/dnbd3-server.service" /etc/systemd/system/dnbd3-server.service || perror "failed."
+ echo "# Linking dnbd3-server service file into (/etc/systemd/system/)multi-user.target.wants..."
+ ln -s /etc/systemd/system/dnbd3-server.service /etc/systemd/system/multi-user.target.wants/dnbd3-server.service \
+ || perror "Could not link dnbd3-server service file into multiuser target!"
}
install_dnbd3-server() {
# $1: directory to install dnbd3-server to
- echo -n "# Installing dnbd3 server... "
- mkdir -p "$1" 2>/dev/null
+ echo "# Installing dnbd3 server... "
+ mkdir -p "$1" || perror "mkdir $1 failed"
for i in dnbd3-server is-enabled; do
- cp "$BASEDIR/static_files/$i" "$1"
+ cp -p "$BASEDIR/static_files/dnbd3/$i" "$1/$i" \
+ || perror "Could not copy $i to $1"
chmod +x "$1/$i"
done
chown -R root:root "$1"
-
- mkdir -p /etc/dnbd3-server 2>/dev/null
+ mkdir -p /etc/dnbd3-server || perror "mkdir /etc/dnbd3-server failed"
for i in rpc.acl server.conf; do
- cp "$BASEDIR/static_files/$i" /etc/dnbd3-server/
+ cp -p "$BASEDIR/static_files/dnbd3/$i" "/etc/dnbd3-server/$i" \
+ || perror "Could not copy $i to /etc/dnbd3-server"
chmod 644 "/etc/dnbd3-server/$i"
done
-
+
install_dnbd3-server_service "/etc/systemd/system/"
echo "# dnbd3-server ok."
}
diff --git a/satellit_installer/static_files/dnbd3-server.service b/satellit_installer/static_files/dnbd3-server.service
deleted file mode 100644
index e623e08..0000000
--- a/satellit_installer/static_files/dnbd3-server.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[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/is-enabled b/satellit_installer/static_files/is-enabled
deleted file mode 100755
index 11d1fb0..0000000
--- a/satellit_installer/static_files/is-enabled
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/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
deleted file mode 100644
index 576757c..0000000
--- a/satellit_installer/static_files/rpc.acl
+++ /dev/null
@@ -1,2 +0,0 @@
-# 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
deleted file mode 100644
index 404e4ff..0000000
--- a/satellit_installer/static_files/server.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-[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
-
diff --git a/satellit_installer/static_files/tftpd/tftpd-hpa b/satellit_installer/static_files/tftpd/tftpd-hpa
new file mode 100644
index 0000000..1e4589b
--- /dev/null
+++ b/satellit_installer/static_files/tftpd/tftpd-hpa
@@ -0,0 +1,6 @@
+# /etc/default/tftpd-hpa
+
+TFTP_USERNAME="tftp"
+TFTP_DIRECTORY="/srv/openslx/tftp"
+TFTP_ADDRESS="0.0.0.0:69"
+TFTP_OPTIONS="--secure"
diff --git a/satellit_installer/static_files/tftpd-hpa.service b/satellit_installer/static_files/tftpd/tftpd-hpa.service
index 2bf6a3a..2bf6a3a 100644
--- a/satellit_installer/static_files/tftpd-hpa.service
+++ b/satellit_installer/static_files/tftpd/tftpd-hpa.service