What's new

how to delay usb disks on AC87U

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Benesch Csaba

Occasional Visitor
Hi all,

I have two hdds, with 4 partiton.

UUID=ff566fb4-d01d-49ca-b01d-c68b1afcc190 swap swap defaults 0 0
UUID=bfd1a872-4008-4ace-9468-1b9fe3fcb9cc /tmp/mnt/optware-ng ext4 rw,nodev,relatime,barrier=1,data=ordered 0 0
UUID=e97a6f5d-dade-4ad5-9ba1-48505444fa21 /tmp/mnt/data1 ext4 rw,nodev,relatime,barrier=1,data=ordered 0 0
UUID=d3d00527-fc54-48ce-825f-25014446d722 /tmp/mnt/data2 ext4 rw,nodev,relatime,barrier=1,data=ordered 0 0


the services started more faster (dont wait for hdds), for example minidlna and transmissiobt give me a error, because optware-ng, data 1 and data2 are not mounted....

I have the following scripts in my jffs:

UUID=ff566fb4-d01d-49ca-b01d-c68b1afcc190 swap swap defaults 0 0
UUID=bfd1a872-4008-4ace-9468-1b9fe3fcb9cc /tmp/mnt/optware-ng ext4 rw,nodev,relatime,barrier=1,data=ordered 0 0
UUID=e97a6f5d-dade-4ad5-9ba1-48505444fa21 /tmp/mnt/data1 ext4 rw,nodev,relatime,barrier=1,data=ordered 0 0
UUID=d3d00527-fc54-48ce-825f-25014446d722 /tmp/mnt/data2 ext4 rw,nodev,relatime,barrier=1,data=ordered 0 0


post-mount script:
#!/bin/sh

if [ "$1" = "/tmp/mnt/optware-ng" ] ; then
ln -nsf $1/optware-ng.arm /tmp/opt
fi

services-start:
#!/bin/sh

RC='/opt/etc/init.d/rc.unslung'

i=60
until [ -x "$RC" ] ; do
i=$(($i-1))
if [ "$i" -lt 1 ] ; then
logger "Could not start Optware-NG"
exit
fi
sleep 1
done
$RC start

init-start:
#!/bin/sh
echo 524288 > /proc/sys/net/core/rmem_max
echo 524288 > /proc/sys/net/core/wmem_max
echo 8192 > /proc/sys/vm/min_free_kbytes

firewall-start:
#!/bin/sh

iptables -I INPUT -p tcp --destination-port 9091 -j ACCEPT
iptables -I INPUT -p tcp --destination-port 51413 -j ACCEPT
iptables -I INPUT -p udp --destination-port 51413 -j ACCEPT


How can I say.... How can I delay all services to waiting first to mount all drives and swap drive?
Firmware ist 380.57.3_HGG-FINAL and I use optware-ng.
 
The router should automatically be restarting the USB related services, like minidlna, samba, etc., when it detects a change in the USB attached drives. Those USB services can actually stop/start several times during boot. There is no way to delay or force a certain order to the various events that occur during the router boot.

Please post a copy of your syslog (editing MAC addresses) that shows the problem.
 
The router should automatically be restarting the USB related services, like minidlna, samba, etc., when it detects a change in the USB attached drives. Those USB services can actually stop/start several times during boot. There is no way to delay or force a certain order to the various events that occur during the router boot.

Please post a copy of your syslog (editing MAC addresses) that shows the problem.

The problem was, that the services has started first, for example by Transmission I get some of errors with the downloaded files (on "data1"), because the usb was not mounted before the transmission. I have edited the post-mount script to:

usb3.0 disk
/dev/sda1 (label=swap)
/dev/sda2/optware-ng (label=optware)
/dev/sda3/data1 (label=data1)

usb2 disk:
/dev/sdb1

#!/bin/sh

if [ "$1" = "/tmp/mnt/optware-ng" ] ; then
ln -nsf $1/optware-ng.arm /tmp/opt
fi

sleep 2m
datestr=$(date +%Y%m%d_%H%M%S)
ps=/jffs/ps
# date used to add to the log file (append) so all the logs will be collected with the date and time no log overwriting....

if grep data1 /etc/mtab &>/dev/null; then
echo $datestr "USB disk for data1 is mounted for media server operation" >> /tmp/syslog.log
else exit
fi

/bin/ps > $ps
if
grep minidlna /jffs/ps &>/dev/null; then
echo $datestr "minidlna server is already started and is not using its new configuration" >> /tmp/syslog.log
else
/opt/etc/init.d/S98minidlna start
fi
rm $ps

if grep data1 /etc/mtab &>/dev/null; then
echo $datestr "USB disk for data1 is mounted for transmission server operation" >> /tmp/syslog.log
else exit
fi

/bin/ps > $ps
if
grep transmission-daemon /jffs/ps &>/dev/null; then
echo $datestr "transmission server is already started and is not using its new configuration" >> /tmp/syslog.log
else
/opt/etc/init.d/S95transmission start
fi
rm $ps

and now working fine. The script is so ok?
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top