diff options
author | Jonathan Bauer | 2016-12-23 13:12:09 +0100 |
---|---|---|
committer | Jonathan Bauer | 2016-12-23 13:12:09 +0100 |
commit | 6806ae4a850fc7785a8c05304237cf53b5b8f951 (patch) | |
tree | b1dd8413d6c7b9a250251da7f0d49bb52b4ddc57 /core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl | |
parent | wrong kernel version variable used (diff) | |
download | mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.gz mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.xz mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.zip |
merge with latest dev version (tm-scripts commit f5a59daf8d70a9027118292cd40b18c221897408)
Diffstat (limited to 'core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl')
-rwxr-xr-x | core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl b/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl index 1eef0a23..979fde62 100755 --- a/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl +++ b/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl @@ -5,6 +5,7 @@ . /opt/openslx/config [ -z "$SLX_SMARTCTL_MIN_REALLOC" ] && SLX_SMARTCTL_MIN_REALLOC=0 +DELAY= FILES= for dev in /dev/sd?; do @@ -20,14 +21,21 @@ for dev in /dev/sd?; do # report if applicable if [ -n "$OVERALL" ]; then slxlog "smartctl-fail" "Failed HDD: $dev reports health as $OVERALL" "$FILE" + DELAY=yes fi if [ -n "$REALLOC" ] && [ "$REALLOC" -gt "$SLX_SMARTCTL_MIN_REALLOC" ]; then slxlog "smartctl-realloc" "Failing HDD: $dev has $REALLOC reallocated sectors!" "$FILE" + DELAY=yes 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" + DELAY=yes fi done -sleep 2 # give slxlog a little time, as it's running async + +[ -n "$DELAY" ] && sleep 2 # give slxlog a little time, as it's running async [ -n "$FILES" ] && rm -f -- $FILES # list, no "" +# Keep it that way instead of using --delete or --sync sonce it would add up; this way we're doing it just once here + +exit 0 |