From d1066678b367942a74ab8c93e65f7bd29b7e3a92 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 Jan 2014 15:39:54 +0100 Subject: [smartctl] Also parse health status reported by drive --- .../data/opt/openslx/scripts/systemd-smartctl | 16 ++++++++++++++-- .../rootfs-stage32/data/opt/openslx/bin/slxlog | 21 +++++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) 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 -- cgit v1.2.3-55-g7522 From 56fbee2c6832a52aa09de77f77421ae4a64d6ff8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 Jan 2014 17:11:45 +0100 Subject: [pam-freiburg] cd to proper dir before launching AUTOSTART --- server/modules/pam-freiburg/etc/profile.d/00-autostart.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/modules/pam-freiburg/etc/profile.d/00-autostart.sh b/server/modules/pam-freiburg/etc/profile.d/00-autostart.sh index a6c4744f..18835457 100755 --- a/server/modules/pam-freiburg/etc/profile.d/00-autostart.sh +++ b/server/modules/pam-freiburg/etc/profile.d/00-autostart.sh @@ -30,7 +30,10 @@ if [ -d "$PERSISTENT_HOME_DIR" ]; then done # Check if user has autostart script and run it (so they can create more symlinks etc.) if [ -x "$PERSISTENT_HOME_DIR/AUTOSTART" ]; then - "$PERSISTENT_HOME_DIR/AUTOSTART" + if cd "$TEMP_HOME_DIR"; then + "$PERSISTENT_HOME_DIR/AUTOSTART" + cd - >/dev/null 2>&1 + fi fi fi -- cgit v1.2.3-55-g7522 From cb109bc835cdfd1166e380a88caeb97013903eef Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 Jan 2014 17:12:22 +0100 Subject: Move package listing from module dir to target dir --- remote/setup_target | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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" -- cgit v1.2.3-55-g7522 From 9cceb9cedb8d06ddd1621f4ed2167ad98ef5a589 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 13 Jan 2014 11:23:14 +0100 Subject: update cups to work with ubuntu 13.10 --- remote/modules/cups/cups.conf.ubuntu.13.10 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 remote/modules/cups/cups.conf.ubuntu.13.10 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 +" -- cgit v1.2.3-55-g7522