PATCH: 5.0-rc11: Error messages during reboot/poweroff


Recommended Posts

Tom,

 

Thanks for a wonderful product.

 

When rebooting or powering off I see the following error messages on the console:

 

  ls: cannot access /dev/hd[a-z]: No such file or directory

 

  /etc/rc.d/rc.unRAID: line 195: echo: write error: Invalid argument

 

These errors are benign but might be alarming to your users.

 

The second error results from issuing a stop command to /proc/mdcmd while the array is already stopped:

 

root@bigben:/etc/rc.d# ./rc.unRAID status | grep State
State: STOPPED
ls: cannot access /dev/hd[a-z]: No such file or directory
root@bigben:/etc/rc.d# echo stop > /proc/mdcmd
-bash: echo: write error: Invalid argument

 

I'd like to suggest a trivial patch to redirect both of these to /dev/null:

 

--- rc.unRAID.orig	2013-02-24 13:06:21.000000000 -0500
+++ rc.unRAID	2013-02-24 13:06:56.000000000 -0500
@@ -192,7 +192,7 @@
        then logger "Stopping the Array"
             echo status > /proc/mdcmd
             cat < /proc/mdcmd | tr -d '\000' > /tmp/mdcmd.$$.1
-            echo stop > /proc/mdcmd
+            echo stop > /proc/mdcmd 2>/dev/null
             sleep 3
             echo status > /proc/mdcmd
             cat < /proc/mdcmd | tr -d '\000' > /tmp/mdcmd.$$.2
@@ -289,7 +289,7 @@

     if [ "${SMARTCTL}" = "YES" ]; then 
        echo "SMART overall health assessment"
-       ls -1 /dev/sd[a-z] /dev/hd[a-z]  | while read DEVICE
+       ls -1 /dev/sd[a-z] /dev/hd[a-z] 2>/dev/null | while read DEVICE
        do echo -e "${DEVICE}: \c"
           smartctl -n standby -H ${DEVICE} 2>&1 | egrep -v 'Home|===|^$|smartctl version|mandatory SMART' 
        done 

 

Cheers,

Greg

Link to comment

There's also a couple of errors coming from ls during boot up.

 

Here's an updated patch:

--- rc.unRAID.orig	2013-02-24 13:06:20.000000000 -0500
+++ rc.unRAID	2013-02-24 13:45:15.000000000 -0500
@@ -60,13 +60,13 @@
     logger -tdiskstats  < /proc/diskstats  

     if [ "${HDPARM}" = "YES" ] ; then 
-       ls -1 /dev/sd[a-z] /dev/hd[a-z]  | while read DEVICE
+       ls -1 /dev/sd[a-z] /dev/hd[a-z] 2>/dev/null | while read DEVICE
        do hdparm -I -i ${DEVICE}
        done 2>&1 | logger -thdparm
     fi

     if [ "${SMARTCTL}" = "YES" ] ; then 
-       ls -1 /dev/sd[a-z] /dev/hd[a-z]  | while read DEVICE
+       ls -1 /dev/sd[a-z] /dev/hd[a-z] 2>/dev/null | while read DEVICE
        do smartctl -n standby -d ata -a ${DEVICE}
        done 2>&1 | sed 's/\t/        /g' | logger -tsmartctl
     fi
@@ -192,7 +192,7 @@
        then logger "Stopping the Array"
             echo status > /proc/mdcmd
             cat < /proc/mdcmd | tr -d '\000' > /tmp/mdcmd.$$.1
-            echo stop > /proc/mdcmd
+            echo stop > /proc/mdcmd 2>/dev/null
             sleep 3
             echo status > /proc/mdcmd
             cat < /proc/mdcmd | tr -d '\000' > /tmp/mdcmd.$$.2
@@ -289,7 +289,7 @@

     if [ "${SMARTCTL}" = "YES" ]; then 
        echo "SMART overall health assessment"
-       ls -1 /dev/sd[a-z] /dev/hd[a-z]  | while read DEVICE
+       ls -1 /dev/sd[a-z] /dev/hd[a-z] 2>/dev/null | while read DEVICE
        do echo -e "${DEVICE}: \c"
           smartctl -n standby -H ${DEVICE} 2>&1 | egrep -v 'Home|===|^$|smartctl version|mandatory SMART' 
        done 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.