dstroot

Members
  • Posts

    79
  • Joined

  • Last visited

Posts posted by dstroot

  1. My server is supposed to go to sleep each night at 10 pm as long as no one is accessing it.  Just noticed in the logs something is croaking everytime the server tries to go to sleep:

     

    Jan  5 22:01:08 Tower kernel: PM: Syncing filesystems ... done.
    Jan  5 22:01:28 Tower kernel: Freezing user space processes ... 
    Jan  5 22:01:28 Tower kernel: Freezing of tasks failed after 20.01 seconds (1 tasks refusing to freeze, wq_busy=0):
    Jan  5 22:01:28 Tower kernel: find            D c14a6fc0     0 17344  17328 0x00800004
    Jan  5 22:01:28 Tower kernel:  f062fed8 00000082 c14a6fc0 c14a6fc0 c14a2000 f04c269c c14a6fc0 f061c62c
    Jan  5 22:01:28 Tower kernel:  00000003 f04c2520 00000003 f062fe88 c1025870 f062feac c101f3fa 00000000
    Jan  5 22:01:28 Tower kernel:  f7546034 f04c2520 f062feb4 c10328d5 00000292 00000292 f04c2520 f062fecc
    Jan  5 22:01:28 Tower kernel: Call Trace:
    Jan  5 22:01:28 Tower kernel:  [] ? default_wake_function+0xb/0xd
    Jan  5 22:01:28 Tower kernel:  [] ? __wake_up_common+0x34/0x5c
    Jan  5 22:01:28 Tower kernel:  [] ? __set_task_blocked+0x66/0x6c
    Jan  5 22:01:28 Tower kernel:  [] ? set_current_blocked+0x27/0x38
    Jan  5 22:01:28 Tower kernel:  [] schedule+0x48/0x4a
    Jan  5 22:01:28 Tower kernel:  [] request_wait_answer+0x11d/0x1b5
    Jan  5 22:01:28 Tower kernel:  [] ? wake_up_bit+0x5b/0x5b
    Jan  5 22:01:28 Tower kernel:  [] fuse_request_send+0x96/0x9c
    Jan  5 22:01:28 Tower kernel:  [] fuse_readdir+0xb9/0x170
    Jan  5 22:01:28 Tower kernel:  [] ? generic_block_fiemap+0x43/0x43
    Jan  5 22:01:28 Tower kernel:  [] vfs_readdir+0x53/0x7e
    Jan  5 22:01:28 Tower kernel:  [] ? generic_block_fiemap+0x43/0x43
    Jan  5 22:01:28 Tower kernel:  [] sys_getdents64+0x63/0xa5
    Jan  5 22:01:28 Tower kernel:  [] syscall_call+0x7/0xb
    Jan  5 22:01:28 Tower kernel: 
    Jan  5 22:01:28 Tower kernel: Restarting tasks ... done.
    

     

    Anyone have any ideas?  I am using the server only as an SMB server - nothing fancy...  Only additions are Joe's cachedirs script, a sleep script, and a script to control the fan.  Nothing else.

     

    Full log attached. 

    log.txt

  2. By setting the lower boundary at the point where the fan won't decrease speed any further I get a nice smooth ramp up:

     

    (note the reported 0 rpm is actually hard coded - the fan never goes below about 720rpm)

     

    Nov 24 09:07:59 Tower fan_speed.sh: Highest disk drive temp is: 31C
    Nov 24 09:07:59 Tower fan_speed.sh: Changing disk drive fan speed from: [OFF (0% @ 0 rpm) ] to: [64 (38% @ 746 rpm) ]
    Nov 24 09:18:07 Tower fan_speed.sh: Highest disk drive temp is: 32C
    Nov 24 09:18:07 Tower fan_speed.sh: Changing disk drive fan speed from: [64 (38% @ 733 rpm) ] to: [78 (47% @ 774 rpm) ]
    Nov 24 09:28:15 Tower fan_speed.sh: Highest disk drive temp is: 33C
    Nov 24 09:28:15 Tower fan_speed.sh: Changing disk drive fan speed from: [78 (47% @ 774 rpm) ] to: [92 (55% @ 819 rpm) ]
    Nov 24 09:48:26 Tower fan_speed.sh: Highest disk drive temp is: 34C
    Nov 24 09:48:26 Tower fan_speed.sh: Changing disk drive fan speed from: [92 (55% @ 815 rpm) ] to: [106 (64% @ 907 rpm) ]
    

  3. Seems there may be an issue with going to sleep (which worked well on 12b):  Snip from my log:

     

    Nov  6 22:01:26 Tower kernel: PM: Syncing filesystems ... done.
    Nov  6 22:01:26 Tower kernel: Freezing user space processes ... 
    Nov  6 22:01:26 Tower kernel: Freezing of tasks failed after 20.01 seconds (1 tasks refusing to freeze, wq_busy=0):
    Nov  6 22:01:26 Tower kernel: find            D c14a6fc0     0 12024  11992 0x00800004
    Nov  6 22:01:26 Tower kernel:  c3fabed8 00000086 c14a6fc0 c14a6fc0 c14a2000 f0644b9c c14a6fc0 f04c0cec
    Nov  6 22:01:26 Tower kernel:  00000003 f0644a20 00000003 c3fabe88 c102585c c3fabeac c101f3e6 00000000
    Nov  6 22:01:26 Tower kernel:  e8430034 f0644a20 c3fabeb4 c10328c1 00000292 00000292 f0644a20 c3fabecc
    Nov  6 22:01:26 Tower kernel: Call Trace:
    Nov  6 22:01:26 Tower kernel:  [] ? default_wake_function+0xb/0xd
    Nov  6 22:01:26 Tower kernel:  [] ? __wake_up_common+0x34/0x5c
    Nov  6 22:01:26 Tower kernel:  [] ? __set_task_blocked+0x66/0x6c
    Nov  6 22:01:26 Tower kernel:  [] ? set_current_blocked+0x27/0x38
    Nov  6 22:01:26 Tower kernel:  [] schedule+0x48/0x4a
    Nov  6 22:01:26 Tower kernel:  [] request_wait_answer+0x11d/0x1b5
    Nov  6 22:01:26 Tower kernel:  [] ? wake_up_bit+0x5b/0x5b
    Nov  6 22:01:26 Tower kernel:  [] fuse_request_send+0x96/0x9c
    Nov  6 22:01:26 Tower kernel:  [] fuse_readdir+0xb9/0x170
    Nov  6 22:01:26 Tower kernel:  [] ? generic_block_fiemap+0x43/0x43
    Nov  6 22:01:26 Tower kernel:  [] vfs_readdir+0x53/0x7e
    Nov  6 22:01:26 Tower kernel:  [] ? generic_block_fiemap+0x43/0x43
    Nov  6 22:01:26 Tower kernel:  [] sys_getdents64+0x63/0xa5
    Nov  6 22:01:26 Tower kernel:  [] syscall_call+0x7/0xb
    Nov  6 22:01:26 Tower kernel: 
    Nov  6 22:01:26 Tower kernel: Restarting tasks ... done.
    Nov  6 23:01:14 Tower kernel: mdcmd (79): spindown 0
    Nov  6 23:01:15 Tower kernel: mdcmd (80): spindown 1
    Nov  6 23:01:15 Tower kernel: mdcmd (81): spindown 2
    Nov  6 23:01:36 Tower emhttp: shcmd (114): /usr/sbin/hdparm -y /dev/sde &> /dev/null
    Nov  6 23:17:27 Tower kernel: PM: Syncing filesystems ... done.
    Nov  6 23:17:27 Tower kernel: Freezing user space processes ... 
    Nov  6 23:17:27 Tower kernel: Freezing of tasks failed after 20.01 seconds (1 tasks refusing to freeze, wq_busy=0):
    Nov  6 23:17:27 Tower kernel: find            D c14a6fc0     0 20568  20540 0x00800004
    Nov  6 23:17:27 Tower kernel:  e8673d70 00000086 c14a6fc0 c14a6fc0 c14a2000 efdcc4dc c14a6fc0 f05f104c
    Nov  6 23:17:27 Tower kernel:  00000002 efdcc360 00000003 e8673d20 c102585c e8673d44 c101f3e6 00000000
    Nov  6 23:17:27 Tower kernel:  e8430034 efdcc360 e8673d4c c10328c1 00000282 00000282 efdcc360 e8673d64
    Nov  6 23:17:27 Tower kernel: Call Trace:
    Nov  6 23:17:27 Tower kernel:  [] ? default_wake_function+0xb/0xd
    Nov  6 23:17:27 Tower kernel:  [] ? __wake_up_common+0x34/0x5c
    Nov  6 23:17:27 Tower kernel:  [] ? __set_task_blocked+0x66/0x6c
    Nov  6 23:17:27 Tower kernel:  [] ? set_current_blocked+0x27/0x38
    Nov  6 23:17:27 Tower kernel:  [] schedule+0x48/0x4a
    Nov  6 23:17:27 Tower kernel:  [] request_wait_answer+0x11d/0x1b5
    Nov  6 23:17:27 Tower kernel:  [] ? wake_up_bit+0x5b/0x5b
    Nov  6 23:17:27 Tower kernel:  [] fuse_request_send+0x96/0x9c
    Nov  6 23:17:27 Tower kernel:  [] fuse_do_open+0xd8/0x12f
    Nov  6 23:17:27 Tower kernel:  [] ? ns_capable+0x35/0x4d
    Nov  6 23:17:27 Tower kernel:  [] fuse_open_common+0x4e/0x69
    Nov  6 23:17:27 Tower kernel:  [] ? fuse_dir_release+0x13/0x13
    Nov  6 23:17:27 Tower kernel:  [] fuse_dir_open+0xd/0xf
    Nov  6 23:17:27 Tower kernel:  [] __dentry_open+0x134/0x208
    Nov  6 23:17:27 Tower kernel:  [] ? fuse_permission+0xa3/0x1f2
    Nov  6 23:17:27 Tower kernel:  [] ? do_lookup+0x7f/0x287
    Nov  6 23:17:27 Tower kernel:  [] nameidata_to_filp+0x45/0x53
    Nov  6 23:17:27 Tower kernel:  [] do_last+0x4e4/0x5d5
    Nov  6 23:17:27 Tower kernel:  [] path_openat+0x9d/0x2a6
    Nov  6 23:17:27 Tower kernel:  [] do_filp_open+0x21/0x60
    Nov  6 23:17:27 Tower kernel:  [] ? getname_flags+0x1e/0xa7
    Nov  6 23:17:27 Tower kernel:  [] do_sys_open+0xf6/0x174
    Nov  6 23:17:27 Tower kernel:  [] sys_open+0x1e/0x26
    Nov  6 23:17:27 Tower kernel:  [] syscall_call+0x7/0xb
    Nov  6 23:17:27 Tower kernel: 
    Nov  6 23:17:27 Tower kernel: Restarting tasks ... done.
    

     

    Thought I'd pass along.  Full log pasted in also. 

    log.txt

  4. for the price of a drive cage you can buy a spare drive in case of failure, or just more capacity.  I think drive cages are overrated.  Having said that - the first unraid I built I used drive cages because I thought they were cool.  Don't need a cage if you only swap a drive once or twice a year is what I discovered - oh and extra problems with the cages due to more points of failure.  The fans in my cages started dying. 

  5. I have a very basic Supermicro X7SPE-HF-525 with 4 Hitachi 2gb coolspins and everthing is working well.  First time using AFP as well - created a TimeMachine user share, turned on AFP and enabled AFP on the share and disabled SMB and my Lion machine can see it, created the sparsebundle and is backing up now.  So from a "nothing fancy" user things look great.  I chose these components to avoid realtek NICs (hate them) and high compatibility. 

     

    Just adding this so people don't get too scared of trying beta 13 (even if you are superstitious)  ;D

  6. Thanks Aiden - didn't mean to call you out on the 5 beta stuff.  I have an even newer version of the script I should post.  I also wrote a 5 beta plugin to learn about plugins hoping we get a "release candidate" of 5 soon but that's a whole different subject.

     

    One thing I will say is thanks to the starter of this thread and all the contributors - I built a box using the case recommended here, an X7SPE-HF-525 board, and 4 Hitatchi 2Tb Coolspin drives and I couldn't be happier.  It's quiet, cool, performs great, looks cool and IPMI is really, really great.  Thanks for the thread!

  7. No, this needs to be made a plugin for the unRAID plugin system.

     

    The best all around solution would be:

    • Tom takes "Simple Features" and makes it the stock, default UnRaid GUI - it looks WAY BETTER than the current stock GUI
    • The rest of us get busy writing V5 plugins that work and look great with the new "stock" GUI
    • The UI is "skinnable" in a way that does not affect the plugins - meaning that plugin development and UI development can proceed independently and people can develop new "looks" for UnRaid the do not affect plugin code.

     

    That would be nivana...

     

    Having used the Simple Features GUI I really can't go back to the stock version - thus any plugins I create will go towards Simple Features.  Sorry - that is the way it is.  People will vote with their time and spent it improving things they like to use.

  8. Yes this might be an issue with race condition between network coming up and plugins being installed.  On my test system (atom based) it's slow enough that it's not an issue, but I'll look into this.

     

    This is still the case for UnRaid 5b12a.  Here is a snippet from my log clearly showing the plugin installer running (and failing) before the network grabs a DHCP lease.  The only thing I canged in the log is my test URL for my image since I didn't want to disclose my personal website at the moment but rest assured the real URL does work and if I run the installplg script manually it successfully installs the plugin.

     

    Oct 11 16:04:46 Tower logger: installing plugin: hello_world-1_0-noarch-1ds
    Oct 11 16:04:46 Tower logger:  file /boot/config/plugins/hello_world/hello_world.png: downloading from http://www.blockedfornow.com/wp-content/uploads/2011/10/fan_speed.png ... bad download, deleting
    Oct 11 16:04:46 Tower emhttp: unRAID System Management Utility version 5.0-beta12a
    Oct 11 16:04:46 Tower emhttp: Copyright (C) 2005-2011, Lime Technology, LLC
    Oct 11 16:04:46 Tower emhttp: Basic key detected, GUID: 
    Oct 11 16:04:46 Tower emhttp: get_config_idx: fopen /boot/config/flash.cfg: No such file or directory - assigning defaults
    Oct 11 16:04:46 Tower emhttp: shcmd (1): udevadm settle
    Oct 11 16:04:46 Tower emhttp: Device inventory:
    Oct 11 16:04:46 Tower emhttp: VMware_Virtual_IDE_Hard_Drive_00000000000000000001 (hda) 1048576
    Oct 11 16:04:46 Tower emhttp: VMware_Virtual_IDE_Hard_Drive_01000000000000000001 (hdb) 1048576
    Oct 11 16:04:46 Tower emhttp: shcmd (2): modprobe md-mod super=/boot/config/super.dat slots=3 |& logger
    Oct 11 16:04:46 Tower kernel: xor: automatically using best checksumming function: pIII_sse
    Oct 11 16:04:46 Tower kernel:    pIII_sse  : 11213.600 MB/sec
    Oct 11 16:04:46 Tower kernel: xor: using function: pIII_sse (11213.600 MB/sec)
    Oct 11 16:04:46 Tower kernel: md: unRAID driver 2.1.3 installed
    Oct 11 16:04:46 Tower kernel: mdcmd (1): import 0 3,0 1048544 VMware_Virtual_IDE_Hard_Drive_00000000000000000001
    Oct 11 16:04:46 Tower kernel: md: import disk0: [3,0] (hda) VMware_Virtual_IDE_Hard_Drive_00000000000000000001 size: 1048544
    Oct 11 16:04:46 Tower kernel: mdcmd (2): import 1 3,64 1048544 VMware_Virtual_IDE_Hard_Drive_01000000000000000001
    Oct 11 16:04:46 Tower kernel: md: import disk1: [3,64] (hdb) VMware_Virtual_IDE_Hard_Drive_01000000000000000001 size: 1048544
    Oct 11 16:04:46 Tower kernel: mdcmd (3): import 2 0,0
    Oct 11 16:04:46 Tower emhttp: shcmd (3): /usr/local/sbin/emhttp_event driver_loaded
    Oct 11 16:04:46 Tower emhttp_event: driver_loaded
    Oct 11 16:04:47 Tower emhttp: shcmd (4): :>/etc/samba/smb-shares.conf
    Oct 11 16:04:47 Tower emhttp: Start SMB...
    Oct 11 16:04:47 Tower emhttp: shcmd (5): /etc/rc.d/rc.samba start |& logger
    Oct 11 16:04:47 Tower logger: Starting Samba:  /usr/sbin/nmbd -D
    Oct 11 16:04:47 Tower logger:                  /usr/sbin/smbd -D
    Oct 11 16:04:47 Tower emhttp: shcmd (6): ps axc | grep -q rpc.mountd
    Oct 11 16:04:47 Tower emhttp: _shcmd: shcmd (6): exit status: 1
    Oct 11 16:04:50 Tower dhcpcd[980]: eth0: offered 10.22.6.178 from 168.114.154.7
    Oct 11 16:04:50 Tower dhcpcd[980]: eth0: acknowledged 10.22.6.178 from 168.114.154.7
    Oct 11 16:04:50 Tower dhcpcd[980]: eth0: checking for 10.22.6.178
    Oct 11 16:04:53 Tower login[1112]: ROOT LOGIN  on '/dev/tty1'
    Oct 11 16:04:55 Tower dhcpcd[980]: eth0: leased 10.22.6.178 for 432000 seconds
    

     

    Cheers Tom!  Hope you can squash this.

  9. Here is a brand new fan script specifically for this motherboard that just needs to be added to your go script - no need for the messy "add it to cron" stuff.  It runs like the cache_dirs and S3 sleep scripts.  Enjoy!  ;D

     

    #!/bin/bash
    #=======================================================================================
    #  Name:	fan_speed.sh
    #=======================================================================================
    #  Description:	
    #
    #  A simple script to check for the highest hard disk temperature and then set the 
    #  fan to an apropriate speed. Fan needs to be connected to a motherboard with pwm 
    #  support.
    #
    #  How to invoke in your "go" script (copy to /boot/scripts):
    #  chmod +x /boot/scripts/fan_speed.sh
    #  /boot/fan_speed.sh
    #=======================================================================================
    # Version 1.0   Authored by Aiden
    # Version 1.1	Modified by Dan Stroot to run in a loop. Does not require the user 
    #               to add this to cron - just start it in your go file.
    # 
    #=======================================================================================
    # Dependencies:	grep,awk,smartctl,hdparm
    #=======================================================================================
    version=1.1
    program_name=`basename $0`
    usage() {
    echo "Usage: $program_name [-t min_temp] [-T max_temp] [-m loop in minutes]"
    echo "       $program_name -V      = print program version "
    echo "       $program_name -q      = quit the program if it is running"
    echo
    echo " Argument descriptions:"
    echo " -t NN    =   set the low disk temp, below this temp the fan is off (default=32)"
    echo " -T NN    =   set the high disk temp, above this temp the fan is 100% (default=38)"
    echo " -m NN    =   number of minutes to wait between fan speed changes (default=5)"
    }
    #=======================================================================================
    # USER DEFINED VARIABLES: *MUST* BE SET TO *YOUR* VALUES
    #=======================================================================================
    # You must load the correct divers for *your* motherboard.  You must run "sensors-detect" at 
    # the command prompt and the add the sensors detected via "modprobe".  You may have to install 
    # perl first - easiest way is via unmenu. Search the forums... 
    # Load adapter drivers:
    modprobe ipmi-si
    # Load chip drivers:
    modprobe coretemp
    modprobe w83627ehf
    
    # Fan device. Depends on *your* system. pwmconfig can help with finding this out. 
    # pwm1 is usually the cpu fan. You can "cat /sys/class/hwmon/hwmon1/device/fan4_input"
    # to see the current rpm of the fan. If 0 then fan is off or there is no fan connected 
    # or motherboard can't read rpm of fan.
    ARRAY_FAN=/sys/class/hwmon/hwmon1/device/pwm4				# Power (speed) setting
    ARRAY_FAN_INPUT=/sys/class/hwmon/hwmon1/device/fan4_input	# Used to track actual rpm values
    #=======================================================================================
    # DEFAULT VARIABLES
    #=======================================================================================
    # Temperature boundaries
    FAN_OFF_TEMP=32		 # Anything this number and below - fan is *off*
    FAN_HIGH_TEMP=38	 # Anything this number and above - fan is *full*
    
    # Fan speed settings. Run pwmconfig (part of the lm_sensors package) to determine 
    # what numbers you want to use for your fan pwm settings. Should not need to
    # change the OFF variable, only the LOW and maybe also HIGH to what you desire.
    # Any real number between 0 and 255.
    FAN_OFF_PWM=10		 # Off Value (note: many PWM fans will not turn off)
    FAN_LOW_PWM=90		 # Value to make your fan go slow
    FAN_HIGH_PWM=195	 # Value to make your fan go fast
    
    MINUTES=5			 # The default number of minutes to loop
    #=======================================================================================
    # PROGRAM LOGIC - CHANGE AT YOUR PERIL 
    #=======================================================================================
    # Get User Input
    while getopts "t:T:m:qhV" opt; do
      case $opt in
      t ) FAN_OFF_TEMP=$OPTARG ;;
      T ) FAN_HIGH_TEMP=$OPTARG ;;
      m ) MINUTES=$OPTARG ;;
      V ) echo $program_name version: $version
          exit 0 ;;
      h ) usage >&2 ; exit 0 ;;
      q ) quit_flag="yes" ;;
      \?) usage >&2 ; exit ;;
      esac
    done
    
    show_values() {
    echo FAN_OFF_TEMP=$FAN_OFF_TEMP
    echo FAN_HIGH_TEMP=$FAN_HIGH_TEMP
    echo FAN_OFF_PWM=$FAN_OFF_PWM
    echo FAN_LOW_PWM=$FAN_LOW_PWM
    echo FAN_HIGH_PWM=$FAN_HIGH_PWM
    echo MINUTES=$MINUTES
    }
    #show_values  # uncomment for debugging
    
    # validate the fan off temp
    cc="$(echo $FAN_OFF_TEMP | sed 's/[0-9]//g')"
    if [ ! -z "$cc" ]
    then
      echo "Error: min fan temp must be numeric (whole number, not negative)." >&2
      usage >&2
      exit 2
    fi
    
    # validate the fan high temp
    cc="$(echo $FAN_HIGH_TEMP | sed 's/[0-9]//g')"
    if [ ! -z "$cc" ]
    then
      echo "Error: max fan temp must be numeric (whole number, not negative)." >&2
      usage >&2
      exit 2
    fi
    
    # validate the minutes
    cc="$(echo $MINUTES | sed 's/[0-9]//g')"
    if [ ! -z "$cc" ]
    then
      echo "Error: minutes must be numeric (whole number, not negative)." >&2
      usage >&2
      exit 2
    fi
    
    # Lockfile processing
    lockfile="/var/lock/fan_speed.LCK"
    if [ -f "${lockfile}" ]; then
    
      # The file exists so read the PID
      # to see if it is still running
      lock_pid=`head -n 1 "${lockfile}"`
    
      pid_running=`ps -p "${lock_pid}" | grep ${lock_pid}`
    
      if [ -z "${pid_running}" ]; then
        if [ "$quit_flag" = "no" ]
        then
          # The process is not running
          # Echo current PID into lock file
          echo $$ > "${lockfile}"
        else
          echo "$program_name ${lock_pid} is not currently running "
          rm "${lockfile}"
          exit 0
        fi
      else
        if [ "$quit_flag" = "yes" ]
        then
          echo killing $program_name process "$lock_pid"
          echo killing $program_name process "$lock_pid" | logger -t$program_name 
          kill "$lock_pid"
          rm "${lockfile}"
          exit 0
        else
          echo "$program_name is already running [${lock_pid}]"
          exit 2
        fi
      fi
    else
      if [ "$quit_flag" = "yes" ]
      then
        echo "$program_name not currently running "
        exit 0
      else
        echo $$ > "${lockfile}"
      fi
    fi
    
    # Enable speed change on fan
    if [ `cat ${ARRAY_FAN}_enable` != "1" ]; then
    echo 1 > "${ARRAY_FAN}_enable"
    fi
    
    # Calculate size of increments. This only needs to be done once so it is ouside of loop.
    FAN_TEMP_INCREMENTS=$(($FAN_HIGH_TEMP-$FAN_OFF_TEMP))  
    FAN_PWM_INCREMENTS=$(($(($FAN_HIGH_PWM-$FAN_LOW_PWM))/$FAN_TEMP_INCREMENTS))
    
    # Obtain the ID of your flash drive (your flash drive is named "UnRaid" right?)
    flash=/dev/`ls -l /dev/disk/by-label| grep UNRAID | cut -d/ -f3 | cut -c 1-3`
    
    # Count the number of drives in your array (ignoring the flash drive we identified)
    NUM_OF_DRIVES=$((ls /dev/[hs]d? | grep -v "$flash") | wc -l)
    
    # Identify the drives in your array so we can test their temperature
    COUNT=1
    for d in $(ls /dev/[hs]d? | grep -v "$flash")
    do
    HD[$COUNT]=$d
    #echo HDD=${HD[$COUNT]}								# Uncomment for debugging
    COUNT=$[$COUNT+1]
    done
    
    function_get_highest_hd_temp() {
    # while loop to get the highest temperature of active drives. 
    # If all are spun down then high temp will be set to 0.	
    CURRENT_TEMP=0
    HIGHEST_TEMP=0
    CURRENT_DRIVE=1
    while [ $CURRENT_DRIVE -le $NUM_OF_DRIVES ]
    do
    	SLEEPING=`hdparm -C ${HD[$CURRENT_DRIVE]} | grep -c standby`
    	if [ "$SLEEPING" -eq 0 ]; then
    		CURRENT_TEMP=`smartctl -d ata -A ${HD[$CURRENT_DRIVE]} | grep -m 1 -i Temperature_Celsius | awk '{print $10}'`
    		if [ "$HIGHEST_TEMP" -le "$CURRENT_TEMP" ]; then
    			HIGHEST_TEMP=$CURRENT_TEMP
    		fi
    	fi
    	CURRENT_DRIVE=$[$CURRENT_DRIVE+1]
    done
    }
    
    function_get_current_fan_speed() {
    # Function to get current fan values
    CURRENT_FAN_SPEED=0
    CURRENT_FAN_RPM=0
    CURRENT_PERCENT_SPEED=0
    CURRENT_FAN_SPEED=`cat $ARRAY_FAN`
    CURRENT_FAN_RPM=`cat $ARRAY_FAN_INPUT`
    CURRENT_PERCENT_SPEED=$(($(($CURRENT_FAN_SPEED*100))/$FAN_HIGH_PWM))
    #echo Current Fan Speed = $CURRENT_FAN_SPEED    		# Uncomment for debugging
    #echo Current Fan RPM = $CURRENT_FAN_RPM				# Uncomment for debugging
    #echo Current Percent Speed = $CURRENT_PERCENT_SPEED	# Uncomment for debugging
    if [ "$CURRENT_FAN_SPEED" -le "$FAN_OFF_PWM" ]; then
    	CURRENT_OUTPUT="OFF (0% @ 0 rpm)"
    	#echo Current output = $CURRENT_OUTPUT				# Uncomment for debugging
    else
    	if [ "$CURRENT_FAN_SPEED" -ge "$FAN_HIGH_PWM" ]; then
    		CURRENT_OUTPUT="FULL (100% @ "$CURRENT_FAN_RPM" rpm)"
    		#echo Current output = $CURRENT_OUTPUT			# Uncomment for debugging
    	else
    		CURRENT_OUTPUT="$CURRENT_FAN_SPEED ($CURRENT_PERCENT_SPEED% @ $CURRENT_FAN_RPM rpm)"
    		#echo Current output = $CURRENT_OUTPUT			# Uncomment for debugging
    	fi
    fi
    }
    
    function_calc_new_fan_speed() {
    # Calculate new fan values based on highest drive temperature
    ADJUSTED_FAN_SPEED=0
    ADJUSTED_PERCENT_SPEED=100
    DIFF_FROM_FAN_OFF_TEMP=0
    DIFF_FROM_FAN_OFF_TEMP=$(($HIGHEST_TEMP-$FAN_OFF_TEMP))
    if [ "$HIGHEST_TEMP" -le "$FAN_OFF_TEMP" ]; then
    	ADJUSTED_FAN_SPEED=$FAN_OFF_PWM
    	ADJUSTED_PERCENT_SPEED=0
    	ADJUSTED_OUTPUT="OFF"
    else
    	if [ "$HIGHEST_TEMP" -ge "$FAN_HIGH_TEMP" ]; then
    		ADJUSTED_FAN_SPEED=$FAN_HIGH_PWM
    		ADJUSTED_PERCENT_SPEED=100
    		ADJUSTED_OUTPUT="FULL"
    	else
    		ADJUSTED_FAN_SPEED=$(($(($DIFF_FROM_FAN_OFF_TEMP*$FAN_PWM_INCREMENTS))+$FAN_LOW_PWM))
    		ADJUSTED_PERCENT_SPEED=$(($(($ADJUSTED_FAN_SPEED*100))/$FAN_HIGH_PWM))
    		ADJUSTED_OUTPUT=$ADJUSTED_FAN_SPEED	 
    	fi
    fi
    #echo Adjusted output = $ADJUSTED_OUTPUT 			# Uncomment for debugging
    }
    
    function_change_fan_speed() {
    # Implemenent fan speed change if neeeded
    if [ "$CURRENT_FAN_SPEED" -ne "$ADJUSTED_FAN_SPEED" ]; then
    	# set fan to new value
    	echo $ADJUSTED_FAN_SPEED > $ARRAY_FAN
    	sleep 5
    	# Get new rpm value
    	ADJUSTED_FAN_RPM=`cat $ARRAY_FAN_INPUT`
    	ADJUSTED_OUTPUT=$ADJUSTED_OUTPUT" ("$ADJUSTED_PERCENT_SPEED"% @ "$ADJUSTED_FAN_RPM" rpm)"
    	# Output the change
    	echo "Highest disk drive temp is: "$HIGHEST_TEMP"C"
    	logger "fan_speed: Highest disk drive temp is: "$HIGHEST_TEMP"C"
    	echo Changing disk drive fan speed from: $CURRENT_OUTPUT to: $ADJUSTED_OUTPUT
    	logger fan_speed: Changing disk drive fan speed from: $CURRENT_OUTPUT to: $ADJUSTED_OUTPUT
    fi
    }
    
    # Main Loop
    while [ -f "$lockfile" ]
    do
    # Get highest drive temperature
    function_get_highest_hd_temp
    
    # Get current fan speed
    function_get_current_fan_speed
    
    # Calculate new fan speed
    function_calc_new_fan_speed
    
    # Cange fan speed if necessary
    function_change_fan_speed
    
    #echo Sleeping for $MINUTES minutes  #uncomment for debugging
    sleep $(($MINUTES*60))
    
    done &
    
    # while loop was put into background, now disown it so it will continue to run when you log off.
    # to get it to stop, type: rm /var/lock/fan_speed.LCK
    background_pid=$!
    echo $background_pid > "${lockfile}"
    echo "$program_name process ID $background_pid started, To terminate it, type: $program_name -q" >&2
    echo "$program_name process ID $background_pid started, To terminate it, type: $program_name -q" | logger -t$program_name 
    disown %%
    

  10. It's probably moot by now since everyone seems to like the .plg naming convention but c'mon folks - if it's an xml file it should have .xml at the end and then ANY xml editor will work just fine. 

     

    People are mostly right about the extention not mattering *after the plugin is coded and tested* but while you are editing it you just want to fire it open in you xml editor and tweak away.

     

    My humble $0.02.

  11. One more thing...

     

    bonienl - sorry I really liked speeding_ant's orginal "clean" header.  It completed the design beautifully.

     

    Adding back the mountains, snow, etc. - is that really necessary?  Don't get me wrong the extensions you are doing from a functionality standpoint are amazing but speeding_ant knocked it out of the park with the original UI.  Your changes to make it look more like the original v5 GUI are going backwards IMHO. 

  12. Regarding the "UI" + "Plugins" vs. "All in One Release" debate:

     

    I feel I need to be "the other side of the coin".

     

    I am a former UnRaid user from way back (I registered on the forums in 2006  ;) ), who left for a while, and just returned to using UnRaid. I have literally spent hours and hours reading the forums to determine all I really want is:

    • A really nice GUI - LOVE this GUI!  Sorry Tom, you are not a GUI person: the stock UI with 5 is terrible (I actually think 5 is worse than 4)
    • Sleep - please sleep my server when I'm not using it
    • Cache Dirs - This is really useful
    • Check parity monthly
    • Send me email if there are any problems - set it and forget it.

     

    Does anyone have any idea how long it takes to educate yourself on the forums - find this stuff and then try to make it work on V5?  I'll give you a hint - sleep is completely different on V5 from V4 - all the sleep scripts you will find on the forums don't work!

     

    So, I for one, LOVE the idea of dropping in one package, and get working versions of this stuff AND a GREAT new GUI on ONE STEP!

     

    Go Speeding_Ant and Bonienl!!!!   ;D

  13. Nothing is ever as simple as it sounds.   ???

     

    I built this machine based on Starcat's tout of the perfect server where everything "just works".  Then I asked specifically:

     

    "For the folks who are actually using the HW defined: X7SPA-HF and Fractal Array case.  Are you running UnRaid 4.7 or one of the new 5 betas?  Will the scripts in this thread work the same on both releases?  I am planning building this exact system and am thinking about starting right off on the latest 5 beta.  Cheers!"

     

    It turns out nothing really works on 5b12a - it is a PITA to get the fan control to work and sleep is handled by a completely different command.  

     

    So here are my tips - first the sleep script is easy.  You only need to change one line:

     

                                   # Go to sleep
    #                                        echo 3 > /proc/acpi/sleep
    # Above deprecated on UnRaid 5 and above
    # To go to sleep use this instead ->
    		echo -n mem >/sys/power/state
    

     

    Fan speed control is simply a non-starter unless you modprobe the correct drivers first.  Here is my code below:

     

    #-----------------------------
    #----- Enable Fan Speed ------
    #-----------------------------
    echo "Starting Fan Script"
    # Adapter drivers
    modprobe ipmi-si						# If you have IPMI
    # Chip drivers
    modprobe coretemp
    modprobe w83627ehf
    chmod +x /boot/scripts/unraid_fan_speed.sh
    crontab -l >/tmp/crontab
    grep -q "unraid_fan_speed.sh" /tmp/crontab 1>/dev/null 2>&1
    if [ "$?" = "1" ]
    then
       crontab -l | egrep -v "control unRAID fan speed based on temperature:|unraid-fan-speed.sh" >/tmp/crontab
       echo "#" >>/tmp/crontab
       echo "# control unRAID fan speed based on temperature" >>/tmp/crontab
       echo "*/2 * * * * /boot/scripts/unraid_fan_speed.sh 1>/dev/null 2>&1" >>/tmp/crontab
       cp /tmp/crontab /var/spool/cron/crontabs/root-
       crontab /tmp/crontab
    fi
    

     

    Make sure you edit the fan speed script to match your HW configuration - see my previous post.

     

    Cheers!  ;D

  14. Rognom:

     

    First this section has to be accurate to what is installed on your system:

     

    ### VARIABLES FOR USER TO SET ###
    # Amount of drives in the array. Make sure it matches the amount you filled out below.
    NUM_OF_DRIVES=3
    
    # unRAID drives that are in the array/backplane of the fan we need to control
    HD[1]=/dev/sda
    HD[2]=/dev/sdb
    HD[3]=/dev/sdc
    #HD[4]=/dev/sdd
    #HD[5]=/dev/sde
    #HD[6]=/dev/sdf
    

     

    If it is not you will certainly get errors like what you are seeing.  You can see what the "sdx" values should be on your UnRaid "Main" page.

     

    Second this also has to match your system:

     

    # Fan device. Depends on your system. pwmconfig can help with finding this out. 
    # pwm1 is usually the cpu fan. You can "cat /sys/class/hwmon/hwmon0/device/fan1_input"
    # or fan2_input and so on to see the current rpm of the fan. If 0 then fan is off or 
    # there is no fan connected or motherboard can't read rpm of fan.
    ARRAY_FAN=/sys/class/hwmon/hwmon1/device/pwm4
    ARRAY_FAN_INPUT=/sys/class/hwmon/hwmon1/device/fan4_input	 # Used to track actual rpm values
    

     

    The way you find these values is "pwmconfig" as indicated in the code above.  Here is what mine looked like:

     

    Testing pwm control hwmon1/device/pwm4 ...

    hwmon1/device/fan4_input ... speed was 1442 now 706

    It appears that fan hwmon1/device/fan4_input is controlled by pwm hwmon1/device/pwm4

     

    So I adjusted the code above to match.  BOOM!  Works.  ;)

  15. anyone any ideas what I am doing wrong?

     

    its my first time using linux...thx

    If you edited the script in any windows editor you may have introduced errors in the line feeds.  Try this:

     

    • Open a telnet session to your server and use the command "mc" to browse through your directory structure.
    • Go to the location of your script and press "F4" to edit it. Press "F12" and choose "Linux Format (LF)".
    • File is saved now in the correct format.