That is an absolutely horrible way to accomplish this. Why didn't you modify your Optware script like I suggested, so that it runs all your Optware "init scripts" at startup like it is designed to do? Simply follow the instructions for: Running /opt/etc/init.d/* on startup in QNAPedia article: Install Optware IPKG?joogoo wrote:Many thanks !pwilson wrote:
I don't own a TS-453, so I can't tell you for sure, but to create it on your NAS, it probably works like the TS-x70 series. The following commands should do it for you:
Warning: This "autorun.sh" solution is specific to newer Intel-based QNAP NAS models. This solution is not correct for QNAP any ARM-based model, or older Intel-based NAS Models. You can modify the /etc/config/autorun.sh script to your requirements thereafter.Code: Select all
mount -t ext2 $(/sbin/hal_app --get_boot_pd port_id=0)6 /tmp/config ln -f /tmp/config/autorun.sh /tmp/config/autorun.sh.OLD rm -f /tmp/config/autorun.sh touch /tmp/config/autorun.sh chmod +x /tmp/config/autorun.sh cat <<EOF >>/tmp/config/autorun.sh #!/bin/sh # AUTORUN.SH - "Boot strap" # This script forces the NAS to run "/etc/config/autorun.sh" at every startup (if this file exists). # /etc/config/autorun.sh touch /tmp/autorun.ran # done EOF echo "unmounting /tmp/config..." umount /tmp/config touch /etc/config/autorun.sh chmod +x /etc/config/autorun.sh cat <<EOF1 >>/etc/config/autorun.sh #!/bin/sh # # /etc/config/autorun.sh - These commands run at every NAS Startup # ### Add your commands here #done EOF1 echo "Edit /etc/config/autorun.sh for all further changes to the autostart procedure of the NAS. #done
I don't for the life of me understand why you would need an autorun.sh at all for this task in the first place. If you need to customize the OpenSSH startup, simply edit /opt/etc/init.d/S40sshd. After you have accomplished this, you will need to follow the instructions for: Running /opt/etc/init.d/* on startup in QNAPedia article: Install Optware IPKG.
Startup scripts located in /opt/etc/init.d/ will run at Optware startup if you follow the instructions in this QNAPedia article. (No "autorun.sh" required).
mount -t ext2 $(/sbin/hal_app --get_boot_pd port_id=0)6 /tmp/config did the trick.
I've been able to mount the ramdisk and add the autorun.sh script.
It did worked well to run because I can see /tmp/autorun.ran every time I reboot the NAS.
But for now, I haven't succeeded to run automatically OpenSSH at startup but there should be something wrong in my autorun.
Here is the code of it if you don't mind helping again :
Thanks again for your help.Code: Select all
#!/bin/sh # # /etc/config/autorun.sh - These commands run at every NAS Startup # ### Add your commands here /opt/etc/init.d/S40sshd start #added line #done
You do not need an "autorun.sh" file for this task at all. If you make the changes as instructed in that QNAPedia article, it will run "/opt/etc/init.d/S40sshd" for you automatically, along with any other Optware "init" scripts in that same /opt/etc/init.d/ directory.