Relating to my footnote in the above post, I have just mounted the flash and looked at own autorun.sh file (to remind me how it was set) and I see it was as is indicated below (which I would have achieved by running chmod 750 autorun.sh):
-rwxr-x--- 1 admin administrators 338 2018-02-27 10:15 autorun.sh*
Of course, you could instead use chmod 110 to make it ---x--x--- and it would still work, but malware with admin privileges could still replace it.
Handy tip
Incidentally, below is a tip that you might find useful (assuming that you are not already doing something similar):
I have the below lines in my autorun.sh file (the one that resides in flash):
Code: Select all
#!/bin/sh
if [ ! -f /share/CACHEDEV1_DATA/Scripts/autorun.sh ]; then
/sbin/log_tool -t 1 -a "[Autorun] For information only: custom autorun.sh wasn't found in the Scripts share."
else
/sbin/log_tool -t 0 -a "[Autorun] Custom autorun.sh file was successfully found in the Scripts share."
/share/CACHEDEV1_DATA/Scripts/autorun.sh
fi
exit 0
I first created a new share called 'Scripts' and in that I have a file (also called autorun.sh) which contains all the actions that I actually wish to run, so the above line '/share/CACHEDEV1_DATA/Scripts/autorun.sh' simply runs the 'autorun.sh' script in my Scripts share. It's quite handy as it means I don't have to mount the flash partition whenever I want to change anything (I just edit the autorun.sh in my 'Scripts' share and reboot). As you can see, for the one that resides in the flash, I've also added a couple of lines which populate the log file. That was done as I have also used this trick on other peoples' Qnaps, so if something doesn't autorun, I can ask them to look at their log file (and thus see if it's likely not working simply because they have accidentally deleted the autorun file in their Scripts share).
Obviously though, the path to the shares can be different with different Qnap models, for example, my older Qnap (and its RAID array), it was instead something like /share/MD0_DATA, and for my single disk Qnap, it was something like /share/HDA_DATA (I can't check as they are not powered up at the moment). Sorry, I do not know where the share directories reside on your model (though its easy enough to check via ssh and navigating about).
All the best
Briain