i was sure that script did not run because I verified the same with touch command. #!/bin/sh echo "my hotplug script" touch test file test did not get created. Thanks. On Wed, Feb 11, 2015 at 9:59 PM, Bin Liu <binmlist@xxxxxxxxx> wrote: > Hi, > > On Wed, Feb 11, 2015 at 10:07 AM, temp sha <temp.sha@xxxxxxxxx> wrote: >> Hi All, >> >> I am trying to enable hotplugging for usb on my h/w based on 2.6.16 kernel. > > I am not sure if you still can get support for such old version. > >> The hotplug kernel module is enabled and I have registered a user >> script "test.sh" >> with the proc file system. >> >> >> /root # echo "/bin/test.sh" > /proc/sys/kernel/hotplug >> >> ------------------- >> /root # cat /proc/sys/kernel/hotplug >> /bin/test.sh >> ------------------- >> >> /root # cat /bin/test.sh >> >> #!/bin/sh >> echo "my hotplug script" > > but I am sure this is not the right way to debug a bash script. See below. > >> ------------------- >> >> I observed that even on plug-in and plug-out my usb device, the >> hotplug script "test.sh" >> is not getting executed though I see that kobject_uevent() of > > How do you know the script is not executed? because you did not see > 'my hot plug script' printout? > I don't know much about /proc/.../hotplug, but I believe it executes > script callbacks without stdin/out, so there should have no console to > display the echo messages. > > I guess you could direct the echo messages to a file in your script to > debug it, for example > > echo "my hot plug script" >> /tmp/hotplug-debug.log > > Regards, > -Bin. > > >> kobject_uevent.c is getting called >> with proper "uevent_helper" and "subsystem" values. Those are >> "/bin/test.sh" and "usb" respectively in this case. Is there any thing >> I am missing here ? (udev is not supported >> in my device.) >> >> >> Thanks in advance. >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-usb" in >> the body of a message to majordomo@xxxxxxxxxxxxxxx >> More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html