fraho
10-05-2008, 10:27
Worked perfectly for me with kfurge's 1.0.4.6 and yes - my rc.local is located in /shares/MYVOLUME1/opt/etc:
#!/opt/bin/bash
export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin
export LD_LIBRARY_PATH=/opt/lib:/apps/lib:/apps/usr/gift-nasoc/lib
export KCSHELL=/opt/bin/bash
#############
# Get nvram variables
#############
pool=`nvram get apps_pool`
share=`nvram get apps_share`
kc_spin_down_hdd=`nvram get kc_spin_down_hdd`
#############
# Misc defines
#############
internal_hdd=/dev/ide/host2/bus0/target0/lun0/disc
#############
# These items only run once at power up
#############
if [ ! -f /tmp/rc.local.done ]; then
# Indicate we've already done this
touch /tmp/rc.local.done
# Do the necessary steps so the internal HDD will enter low power
# idle after 5 minutes and low RPM idle after 1 hour
if [ "$kc_spin_down_hdd" != "No" ]; then
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -B 164 ${internal_hdd}
hdparm -B 114 ${internal_hdd}
smartctl -dT ${internal_hdd}
fi
# Kill utelnetd and restart it only on the LAN interface
killall utelnetd
utelnetd -d -i br0
# Start dropbear ssh server
if [ -x /opt/etc/init.d/S51dropbear ]; then
/opt/etc/init.d/S51dropbear
fi
# Start MLDonkey
if [ -x /opt/etc/init.kc/start_mldonkey.sh ]; then
/opt/etc/init.kc/start_mldonkey.sh
fi
fi
###############
# Everything from here on runs whenever the configuration changes
###############
# Fix passwd and groups files
/opt/etc/init.kc/fix_passwd.sh
/opt/etc/init.kc/fix_group.sh
# Set hostname
hostname `nvram get machine_name`
# Poke holes in the firewall for certain applications
/opt/etc/init.kc/iptables_mldonkey.sh
/opt/etc/init.kc/iptables_ssh.sh
This is my old rc.local (the one that worked with 1.0.4.6) which is still located in /shares/MYVOLUME1:
cat /proc/mounts > /opt/etc/fstab
ln -s /opt/etc/shells /tmp/shells
ln -s /opt/etc/fstab /tmp/fstab
export PATH=/opt/bin:/opt/sbin:${PATH}
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
fi
# Start utelnetd on local interface only!
/apps/bin/utelnetd -i br0 &
# Sleep for a little bit to not interfere with normal system startup
# before we kill a bunch of Asus processes.
sleep 5
# The killing of watchdog is necessary
# to allow the disk to spin down (watchdog is a horribly written hack
# anyway!)
killall -q -9 watchdog
# Do the necessary steps so the internal HDD will spin down
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -S 180 ${internal_hdd}
smartctl -dT ${internal_hdd}
fi
Is it o.k. to just exchange the new one with the old one and my disk will spin down again?
btw: What do I have to add to rc.local when I want an external USB-Disk to spin down as well?
Another problem with kfurge 1.0.7.8: When I try to reach the ftp-shares via browser I get a "Website cannot be displayed" message, whereas it's still possible to access the ftp-share with an ftp program like leechftp.
I really hate myself for having changed a running system. :mad:
Any help would be greatly appreciated
#!/opt/bin/bash
export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin
export LD_LIBRARY_PATH=/opt/lib:/apps/lib:/apps/usr/gift-nasoc/lib
export KCSHELL=/opt/bin/bash
#############
# Get nvram variables
#############
pool=`nvram get apps_pool`
share=`nvram get apps_share`
kc_spin_down_hdd=`nvram get kc_spin_down_hdd`
#############
# Misc defines
#############
internal_hdd=/dev/ide/host2/bus0/target0/lun0/disc
#############
# These items only run once at power up
#############
if [ ! -f /tmp/rc.local.done ]; then
# Indicate we've already done this
touch /tmp/rc.local.done
# Do the necessary steps so the internal HDD will enter low power
# idle after 5 minutes and low RPM idle after 1 hour
if [ "$kc_spin_down_hdd" != "No" ]; then
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -B 164 ${internal_hdd}
hdparm -B 114 ${internal_hdd}
smartctl -dT ${internal_hdd}
fi
# Kill utelnetd and restart it only on the LAN interface
killall utelnetd
utelnetd -d -i br0
# Start dropbear ssh server
if [ -x /opt/etc/init.d/S51dropbear ]; then
/opt/etc/init.d/S51dropbear
fi
# Start MLDonkey
if [ -x /opt/etc/init.kc/start_mldonkey.sh ]; then
/opt/etc/init.kc/start_mldonkey.sh
fi
fi
###############
# Everything from here on runs whenever the configuration changes
###############
# Fix passwd and groups files
/opt/etc/init.kc/fix_passwd.sh
/opt/etc/init.kc/fix_group.sh
# Set hostname
hostname `nvram get machine_name`
# Poke holes in the firewall for certain applications
/opt/etc/init.kc/iptables_mldonkey.sh
/opt/etc/init.kc/iptables_ssh.sh
This is my old rc.local (the one that worked with 1.0.4.6) which is still located in /shares/MYVOLUME1:
cat /proc/mounts > /opt/etc/fstab
ln -s /opt/etc/shells /tmp/shells
ln -s /opt/etc/fstab /tmp/fstab
export PATH=/opt/bin:/opt/sbin:${PATH}
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
fi
# Start utelnetd on local interface only!
/apps/bin/utelnetd -i br0 &
# Sleep for a little bit to not interfere with normal system startup
# before we kill a bunch of Asus processes.
sleep 5
# The killing of watchdog is necessary
# to allow the disk to spin down (watchdog is a horribly written hack
# anyway!)
killall -q -9 watchdog
# Do the necessary steps so the internal HDD will spin down
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -S 180 ${internal_hdd}
smartctl -dT ${internal_hdd}
fi
Is it o.k. to just exchange the new one with the old one and my disk will spin down again?
btw: What do I have to add to rc.local when I want an external USB-Disk to spin down as well?
Another problem with kfurge 1.0.7.8: When I try to reach the ftp-shares via browser I get a "Website cannot be displayed" message, whereas it's still possible to access the ftp-share with an ftp program like leechftp.
I really hate myself for having changed a running system. :mad:
Any help would be greatly appreciated