How to create a autorun file in linux which is similar to autorun.inf in Windows in order to execute a shell file ie Following are the requirment
1.Autorun the in开发者_StackOverflow中文版staller file ./example.sh
When CD is mounted onto the system .
this is not possible. would be too much of a risk. You can of course do this for your own system in various variants. for example cronjobs. but i suppose you want it to run on any other system...
Rule #1 in Linux's Security: Any new Executable file come to system haven't the due to execute himself without permission from his user/owner :) you can make an autorun for your system but for other systems nop I guess
we might use our udev rules :
mount /mnt/flash && sh /mnt/flash/autorun.sh
with proper device signature (product id, device id).
or
use "autorun" command, which currently works with cdrom.
精彩评论