summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
authorJonathan Bauer2013-12-20 17:47:01 +0100
committerJonathan Bauer2013-12-20 17:47:01 +0100
commit808559e1cad1747825984174248f4fdf5803ae8e (patch)
tree6a69f5c4cfffcf9400a15f684d9658c67aaba9ff /remote/modules
parent[rootfs-stage32] added 'getent' to stage32 (diff)
parentMerge branch 'master' of dnbd3:openslx-ng/tm-scripts (diff)
downloadtm-scripts-808559e1cad1747825984174248f4fdf5803ae8e.tar.gz
tm-scripts-808559e1cad1747825984174248f4fdf5803ae8e.tar.xz
tm-scripts-808559e1cad1747825984174248f4fdf5803ae8e.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules')
-rw-r--r--remote/modules/dnbd3/dnbd3.conf2
l---------remote/modules/smartctl/data/etc/systemd/system/basic.target.wants/smartctl.service1
-rw-r--r--remote/modules/smartctl/data/etc/systemd/system/smartctl.service8
-rwxr-xr-xremote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl19
-rw-r--r--remote/modules/smartctl/smartctl.build13
-rw-r--r--remote/modules/smartctl/smartctl.conf5
-rw-r--r--remote/modules/smartctl/smartctl.conf.ubuntu6
-rw-r--r--remote/modules/systemd/systemd-openslx.patch26
-rw-r--r--remote/modules/systemd/systemd.build9
9 files changed, 84 insertions, 5 deletions
diff --git a/remote/modules/dnbd3/dnbd3.conf b/remote/modules/dnbd3/dnbd3.conf
index 31966cea..333637fd 100644
--- a/remote/modules/dnbd3/dnbd3.conf
+++ b/remote/modules/dnbd3/dnbd3.conf
@@ -2,7 +2,7 @@
#REQUIRED_CONTENT_PACKAGES="libgconf-2-4 fontconfig-config"
REQUIRED_MODULES="kernel"
REQUIRED_GIT="git://git.openslx.org/dnbd3.git"
-REQUIRED_COMMIT="ed82742933b694e8732fe01fc7c1c2542c027c26"
+REQUIRED_COMMIT="32ca216b49b2417a102457ce54bdd9bb76d6f02d"
REQUIRED_BINARIES="
dnbd3-client
"
diff --git a/remote/modules/smartctl/data/etc/systemd/system/basic.target.wants/smartctl.service b/remote/modules/smartctl/data/etc/systemd/system/basic.target.wants/smartctl.service
new file mode 120000
index 00000000..b0849c0c
--- /dev/null
+++ b/remote/modules/smartctl/data/etc/systemd/system/basic.target.wants/smartctl.service
@@ -0,0 +1 @@
+../smartctl.service \ No newline at end of file
diff --git a/remote/modules/smartctl/data/etc/systemd/system/smartctl.service b/remote/modules/smartctl/data/etc/systemd/system/smartctl.service
new file mode 100644
index 00000000..ab268cbc
--- /dev/null
+++ b/remote/modules/smartctl/data/etc/systemd/system/smartctl.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Check HDD health status
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/opt/openslx/scripts/systemd-smartctl
+
diff --git a/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl b/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl
new file mode 100755
index 00000000..6025c962
--- /dev/null
+++ b/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl
@@ -0,0 +1,19 @@
+#!/bin/ash
+
+# Check Reallocated_Sector_Ct and Spin_Retry_Count of local disk(s)
+
+FILE=$(mktemp)
+for dev in /dev/sd?; do
+ smartctl -A "$dev" -f "brief" > "$FILE" || continue # should we report devices where smartctl doesn't work?
+ REALLOC=$(grep "^ *5 " "$FILE" | awk '{print $8}')
+ SPINRETRY_VAL=$(grep "^ *10 " "$FILE" | awk '{print $4}')
+ SPINRETRY_THR=$(grep "^ *10 " "$FILE" | awk '{print $6}')
+ if [ -n "$REALLOC" ] && [ "$REALLOC" != "0" ]; then
+ slxlog "smartctl-realloc" "Failing HDD: $dev has $REALLOC reallocated sectors!" "$FILE"
+ fi
+ if [ -n "$SPINRETRY_VAL" ] && [ "$SPINRETRY_VAL" -le "$SPINRETRY_THR" ]; then
+ slxlog "smartctl-spinretry" "Failing HDD: $dev has bad spin retry count! ($SPINRETRY_VAL/$SPINRETRY_THR)" "$FILE"
+ fi
+done
+rm -f -- "$FILE"
+
diff --git a/remote/modules/smartctl/smartctl.build b/remote/modules/smartctl/smartctl.build
new file mode 100644
index 00000000..435a7b10
--- /dev/null
+++ b/remote/modules/smartctl/smartctl.build
@@ -0,0 +1,13 @@
+fetch_source() {
+ :
+}
+
+build() {
+ COPYLIST="list_dpkg_output"
+ list_packet_files > "$COPYLIST"
+ tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}"
+}
+
+post_copy() {
+ :
+}
diff --git a/remote/modules/smartctl/smartctl.conf b/remote/modules/smartctl/smartctl.conf
new file mode 100644
index 00000000..9ea1ed03
--- /dev/null
+++ b/remote/modules/smartctl/smartctl.conf
@@ -0,0 +1,5 @@
+REQUIRED_BINARIES="
+ smartctl
+"
+REQUIRED_LIBRARIES=""
+REQUIRED_DIRECTORIES=""
diff --git a/remote/modules/smartctl/smartctl.conf.ubuntu b/remote/modules/smartctl/smartctl.conf.ubuntu
new file mode 100644
index 00000000..d699f2f0
--- /dev/null
+++ b/remote/modules/smartctl/smartctl.conf.ubuntu
@@ -0,0 +1,6 @@
+REQUIRED_CONTENT_PACKAGES="
+ smartmontools
+"
+REQUIRED_INSTALLED_PACKAGES="
+ smartmontools
+"
diff --git a/remote/modules/systemd/systemd-openslx.patch b/remote/modules/systemd/systemd-openslx.patch
new file mode 100644
index 00000000..36de20b0
--- /dev/null
+++ b/remote/modules/systemd/systemd-openslx.patch
@@ -0,0 +1,26 @@
+--- core/main.c 2013-05-09 15:45:50.000000000 +0200
++++ core/main.c 2013-12-19 14:46:03.020362993 +0100
+@@ -1477,9 +1477,9 @@
+ /* Set up PATH unless it is already set */
+ setenv("PATH",
+ #ifdef HAVE_SPLIT_USR
+- "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
++ "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin",
+ #else
+- "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin",
++ "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin",
+ #endif
+ arg_running_as == SYSTEMD_SYSTEM);
+
+@@ -1513,6 +1513,11 @@
+ unsetenv("LISTEN_FDS");
+ unsetenv("LISTEN_PID");
+
++ /* OpenSLX: "Fix" libc/nss/nss_ldap deadlock
++ * when not using nscd */
++ setenv("HOME", "/", 1);
++ setenv("USER", "root", 1);
++
+ /* All other variables are left as is, so that clients
+ * can still read them via /proc/1/environ */
+ }
diff --git a/remote/modules/systemd/systemd.build b/remote/modules/systemd/systemd.build
index c9d23794..2c15eccf 100644
--- a/remote/modules/systemd/systemd.build
+++ b/remote/modules/systemd/systemd.build
@@ -1,12 +1,13 @@
#tool/distro specific functions for fetching, building and installing dependencies
fetch_source () {
+ # systemd
download_untar "$REQUIRED_URL" "src/"
- download_untar "$REQUIRED_LIBKMOD_URL" "src/"
+ # Patch PATH, HOME, USER environment
+ patch -p0 src/systemd-*/src/core/main.c < systemd-openslx.patch || perror "Failed to apply openslx systemd patch."
- # Patch PATH environment
- sed -s -i -r 's#"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin(:/sbin:/bin)?"#& ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin"#g' src/systemd-*/src/core/main.c
- sed -s -i -r 's#"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"#& ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin"#g' src/systemd-*/src/nspawn/nspawn.c
+ # libkmod
+ download_untar "$REQUIRED_LIBKMOD_URL" "src/"
}
build () {