summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
Diffstat (limited to 'remote')
-rw-r--r--remote/modules/cups/cups.conf.ubuntu.13.1010
-rwxr-xr-xremote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl16
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog21
-rwxr-xr-xremote/setup_target6
4 files changed, 42 insertions, 11 deletions
diff --git a/remote/modules/cups/cups.conf.ubuntu.13.10 b/remote/modules/cups/cups.conf.ubuntu.13.10
new file mode 100644
index 00000000..eaf19ce8
--- /dev/null
+++ b/remote/modules/cups/cups.conf.ubuntu.13.10
@@ -0,0 +1,10 @@
+REQUIRED_INSTALLED_PACKAGES="
+ cups
+ cups-daemon
+ cups-filters
+"
+REQUIRED_CONTENT_PACKAGES="
+ cups
+ cups-daemon
+ cups-filters
+"
diff --git a/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl b/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl
index 6025c962..6a798563 100755
--- a/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl
+++ b/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl
@@ -2,18 +2,30 @@
# Check Reallocated_Sector_Ct and Spin_Retry_Count of local disk(s)
+. /opt/openslx/config
+
+[ -z "$SLX_SMARTCTL_MIN_REALLOC" ] && SLX_SMARTCTL_MIN_REALLOC=0
+
FILE=$(mktemp)
for dev in /dev/sd?; do
- smartctl -A "$dev" -f "brief" > "$FILE" || continue # should we report devices where smartctl doesn't work?
+ smartctl -H -A -f "brief" "$dev" > "$FILE" || continue # should we report devices where smartctl doesn't work?
+ # parse
+ OVERALL=$(grep -o "test result: .*$" "$FILE" | cut -c 14-)
+ [ "x$OVERALL" = "xPASSED" ] && OVERALL=""
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
+ # report if applicable
+ if [ -n "$OVERALL" ]; then
+ slxlog "smartctl-fail" "Failed HDD: $dev reports health as $OVERALL" "$FILE"
+ fi
+ if [ -n "$REALLOC" ] && [ "$REALLOC" -gt "$SLX_SMARTCTL_MIN_REALLOC" ]; 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
+sleep 2 # give slxlog a little time, as it's running async
rm -f -- "$FILE"
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog
index afe72a2d..b80d55cf 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog
@@ -47,18 +47,27 @@ if [ $# -lt 2 ]; then
else
MSG="$2"
fi
-MSG="[$(whoami)] $MSG"
+USER=$(whoami)
+MSG="[$USER] $MSG"
if [ $# -gt 2 ]; then
EXTRA="$3"
fi
-if [ -n "$EXTRA" ] && [ -r "$EXTRA" -a -s "$EXTRA" ] && [ "$(stat -c %s "$EXTRA")" -lt "10000" ]; then
- curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc@$EXTRA" "$SLX_REMOTE_LOG" > /dev/null 2>&1 &
-elif [ -n "$EXTRA" ]; then
- curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc=Missing/too large: $EXTRA" "$SLX_REMOTE_LOG" > /dev/null 2>&1 &
+if [ -n "$SLX_DEBUG" ]; then
+ CURLLOG="/tmp/slxlog.$USER"
else
- curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" "$SLX_REMOTE_LOG" > /dev/null 2>&1 &
+ CURLLOG="/dev/null"
+fi
+
+if [ -n "$EXTRA" ] && [ -r "$EXTRA" -a -s "$EXTRA" ] && [ "$(stat -c %s "$EXTRA")" -lt "10000" ]; then # valid file attachment
+ curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc@$EXTRA" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 &
+elif [ -z "$EXTRA" ]; then # no attachment
+ curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 &
+elif [ -s "$EXTRA" ]; then # empty attachment file (or missing)
+ curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc=Attachment too large: $EXTRA" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 &
+else # attachment file to big (more than 10k)
+ curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc=Attachment missing/empty: $EXTRA" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 &
fi
exit 0
diff --git a/remote/setup_target b/remote/setup_target
index 1fd059fc..5fc68a4f 100755
--- a/remote/setup_target
+++ b/remote/setup_target
@@ -134,8 +134,8 @@ copy_files_with_deps () {
[ ! -d "$MODULE_BUILD_DIR" ] && pinfo "No build directory found, skipping dependency copying" && return 0
cd "$MODULE_BUILD_DIR"
- local COPYFILES_LIST="$MODULE_BUILD_DIR/copy_files_with_deps.filelist"
- [ -e "${COPYFILES_LIST}" ] && rm "${COPYFILES_LIST}"
+ local COPYFILES_LIST="${TARGET_BUILD_DIR}/opt/openslx/.mltk/${MODULE}.copy_files_with_deps"
+ rm -f -- "${COPYFILES_LIST}"
# from REQUIRED_BINARIES - follow symlinks and ldd the file
[ ! -z "${REQUIRED_BINARIES}" ] && pinfo "Gathering required binaries from config file..."
@@ -503,7 +503,7 @@ clean_module() {
rm -rf -- "${MODULE_DIR}/src" || perror "Could not delete src path"
rm -f -- "${MODULE_DIR}/list_dpkg_output" || perror "Could not delete list_dpkg_output"
rm -f -- "${MODULE_DIR}/list_binaries_and_files" || perror "Could not delete list_binaries_and_files"
- rm -f -- "${TARGET_BUILD_DIR}/opt/openslx/.mltk/${MODULE}.md5"
+ rm -f -- "${TARGET_BUILD_DIR}/opt/openslx/.mltk/${MODULE}."* # no space here!
# These are not in use anymore, but leave the cleanup here for upgraders
rm -f -- "${MODULE_DIR}/.built"
rm -f -- "${MODULE_DIR}/.fetched_source"