Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to develop a SW in which the SW has to determine when any USB is connected,it has to identify and do the Read and write operation with the pendrive.
I have to identify the moment when pendrive is connected.System has no GUI only Black Box.
Im using RHEL with Kernel 2.6.18.
My question is how to identify if pendrive is connected.Is any System flag or some other thing will set In OS?
I need to develop a SW in which the SW has to determine when any USB is connected,it has to identify and do the Read and write operation with the pendrive.
I have to identify the moment when pendrive is connected.System has no GUI only Black Box.
Im using RHEL with Kernel 2.6.18.
My question is how to identify if pendrive is connected.Is any System flag or some other thing will set In OS?
Please help me out to solve this problem
Many Thanks in Advance
Yuvi
Definitely while external drives are plugged certain drivers are responsible for setting flags .. But i'm not quite sure which functions is invoked , either ioctl() or not .. Wait for others to reply
command lsusb is been invoked by surely a function which set flags ..
You should provide more info such as which kernel you are using. The architecture, etc. The udevd daemon can be configured to launch a program, but this is better for short scripts.
You might want to look at ivman.
Code:
DETAILS
Ivman is a flexible device manager, allowing users to run arbitrary commands when devices are added/removed, when device properties change, and when
devices emit conditions.
You should provide more info such as which kernel you are using. The architecture, etc. The udevd daemon can be configured to launch a program, but this is better for short scripts.
You might want to look at ivman.
Code:
DETAILS
Ivman is a flexible device manager, allowing users to run arbitrary commands when devices are added/removed, when device properties change, and when
devices emit conditions.
kernel used is 2.6.18.
Im very new to linux....what is Ivman
Ivman will automount the pendrive or sdcard automatically and can be used to run an arbitrary script. It is lighter weight than udev/dbus/hal/polkit AFAIK. Your application sounds like either for an embedded device or kiosk or VAR system.
Look if your distro supplies it. On mine it is installed but not used by default.
I asked for the kernel version because isn't uncommon for embedded device to run a different architecture or use a 2.5 kernel which may not have udev or hal support.
Ivman will automount the pendrive or sdcard automatically and can be used to run an arbitrary script. It is lighter weight than udev/dbus/hal/polkit AFAIK. Your application sounds like either for an embedded device or kiosk or VAR system.
Look if your distro supplies it. On mine it is installed but not used by default.
I asked for the kernel version because isn't uncommon for embedded device to run a different architecture or use a 2.5 kernel which may not have udev or hal support.
It is for embedded device only.I have mentioned kernel version only.any way it is RHEL with Kernel 2.6
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.