DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-03-13 22:51:50

En3rGy
Member
Registered: 2010-03-09
Posts: 6

No Hibernation while shell script running

Hello together,

I'm using a simple shell script for fan speed control (fan_ctrl.sh). I use ffp, so I wrote an autostart script (fan_start.sh).
Unfortunately, running the script prevents the NAS-323 to hibernate. Calling "ps | grep fan" returns entries for both scripts.
Any  suggestions, how to run the fan_ctrl script and getting the drives to sleep?


fan_start.sh:

Code:

!/ffp/bin/sh
# PROVIDE: sshd
# REQUIRE: LOGIN

. /ffp/etc/ffp.subr

name="fan_ctrl.sh"
command="/ffp/bin/$name"
sshd_flags=

start_cmd="fan_ctrl_start"

fan_ctrl_start()
{
  proc_start $command &
}

run_rc_command "$1"

fan_ctrl.sh:

Code:

MIN=38
MAX=42

while true
do
  TEMP=$(temperature g 0 | grep '=' | awk '{print $5}')
  if [ $TEMP -lt $MIN ]
  then
    echo $(date): "Temperature = $TE $TEMP," $(fanspeed s)
  else
    if [ $TEMP -gt $MAX ]
    then
      echo $(date): "Temperature = $TE $TEMP," $(fanspeed h)
    else
      echo $(date): "Temperature = $TE $TEMP," $(fanspeed l)
    fi
  fi
  sleep 60
done

Last edited by En3rGy (2010-03-14 00:12:21)

Offline

 

#2 2010-03-14 20:17:44

karlrado
Member
Registered: 2009-12-07
Posts: 229

Re: No Hibernation while shell script running

You might look at:

http://dns323.kood.org/hardware:fan

Note that a lot of care is taken to avoid any scripts accessing files on the hard drive, which would make it spin up.  In your case, it is likely that grep and awk are on the hard disk (maybe in /ffp/bin) and that will keep the hard drive from sleeping.


DNS-323 FW 1.07 : 2 1TB WD Caviar Green SATA : fun_plug: utelnet + optware (no ffp)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB