Autorun with Entware-ng

Discussion on setting up QNAP NAS products.
Post Reply
wizzardking
New here
Posts: 9
Joined: Tue Nov 06, 2012 7:11 am

Autorun with Entware-ng

Post by wizzardking »

Hi

I'm trying to mount an external source with sshfs automaticly when my nas starts.

Autorun seems to be working fine, i have tested it with an mkdir command. Also if i start my autorun script manually, it works properly.
But it seems, like autorun trys to start, before entware-ng is loaded. At least it's not possible to use packages which was installed by entware-ng (like sshfs) in the autorun script.
Does anyone knows a workaround for this problem?

Used Model: TS-451+
Firmware: 4.3.3.0299

used command in my autorun script:

Code: Select all

/opt/bin/sshfs -o IdentityFile=/share/CACHEDEV2_DATA/TV/id_rsa user@ip-adress:/ /share/CACHEDEV2_DATA/TV/Media -o reconnect,transform_symlinks
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: Autorun with Entware-ng

Post by schumaku »

Add some delay until Entware-NG is up and the binary does exist, here a code sniplet of what I would do in bash:

Code: Select all

...
while [ ! -f /opt/bin/sshfs ]
do
  sleep 30
done
/opt/bin/sshfs -o ....
wizzardking
New here
Posts: 9
Joined: Tue Nov 06, 2012 7:11 am

Re: Autorun with Entware-ng

Post by wizzardking »

Thank you very much for your reply. But this doesn't seem to work.
It seems that QNAP will just start the QPKGs when the Autorun is finished. So on rebooting, it never starts the the Entware-Ng QPKG, and with this, the autorun script can never finish.
mramor
New here
Posts: 7
Joined: Mon Feb 23, 2015 5:57 am

Re: Autorun with Entware-ng

Post by mramor »

Consider using Entware-based startup script placed in /opt/etc/init.d. For example, I'm using the following script to run rar2fs:

Code: Select all

#!/bin/sh

start() {
    /opt/bin/rar2fs --seek-length=1 --iob-size=8 /share/CACHEDEV1_DATA/RAR /share/CACHEDEV1_DATA/UNRAR
}

stop() {
    umount /share/CACHEDEV1_DATA/UNRAR
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        ;;
esac
Post Reply

Return to “Turbo Station Installation & Setup”