If it's yenta_socket, it's probably some program that's using a PCMCIA device.
If the module you are trying to unload is a device driver module, first do
You'll see a list of module names and associated device numbers, for example:
Code:
Character devices:
1 mem
2 pty
3 ttyp
4 ttyS
5 cua
7 vcs
10 misc
13 input
14 sound
21 sg
29 fb
36 netlink
Then you can look in /dev and see which devices have that major number; in that pair of numbers just before the data, the first one is the major number. For example:
Code:
$ ls -la /dev | grep " 14,"
crw------- 1 root root 14, 4 Aug 30 2002 audio
crw------- 1 root root 14, 20 Aug 30 2002 audio1
crw------- 1 root root 14, 7 Aug 30 2002 audioctl
crw------- 1 root root 14, 3 Aug 30 2002 dsp
crw------- 1 root root 14, 19 Aug 30 2002 dsp1
crw------- 1 root root 14, 2 Aug 30 2002 midi00
crw------- 1 root root 14, 18 Aug 30 2002 midi01
crw------- 1 root root 14, 34 Aug 30 2002 midi02
crw------- 1 root root 14, 50 Aug 30 2002 midi03
crw------- 1 root root 14, 0 Aug 30 2002 mixer
crw------- 1 root root 14, 16 Aug 30 2002 mixer1
crw------- 1 root root 14, 17 Aug 30 2002 patmgr0
crw------- 1 root root 14, 33 Aug 30 2002 patmgr1
crw------- 1 root root 14, 1 Aug 30 2002 sequencer
crw------- 1 root root 14, 8 Aug 30 2002 sequencer2
crw------- 1 root root 14, 6 Aug 30 2002 sndstat
And that might give you a hint as to which program it is. I
know there's a way to list all open files by all processes, and I'll be damned if I can remember what it is. You could use that to see which processes have the device in question open.
It's also possible that another module caused your module to load, indirectly. In that case, that other module will be listed in the "used by" column in lsmod, and you can look for that module instead.
There's probably a better way to do all of this, too. But I don't know it, although I'd like to. You could probably poke around in /proc/*/fd and write a script or use
find or something to figure out which process has the device open. That's all assuming it's a device driver module that's actually associated with some device that a process is using, of course.
Sorry, that's the best I could come up with.
Jason