I'm trying to programatically stomp on bluetooth on RHEL5.
I've got the service stopped -- no problem. Also no problem on rpm -e
for the associated bluetooth packages, bluez-*.
ps -aef | grep -v grep | egrep -c '(sdpd|hcid)'
returns zero , so I know the daemons are gone.
For some reason, I just can't get the modules to unload. modprobe -rv
keeps saying they're in use.
Dependencies look like this:
bluetooth -> bnep
-> l2cap
-> rfcomm
-> hidp
-> rfcomm
-> hidp
But, even starting at the top so that dependencies are simple, modprobe -rv bluetooth
returns FATAL: Module bluetooth is in use.
So, how do I find out what processes are using this module? It doesn't seem to be in /proc/modules, or lsof.
Command lsof
still shows something hooked.
# lsmod | egrep '(bnep|hidp|rfcomm|l2cap|bluetooth)'
bnep 82241 0
hidp 83521 0
rfcomm 104809 0
l2cap 89281 5 bnep,hidp,rfcomm
bluetooth 118597 4 bnep,hidp,rfcomm,l2cap
When you do an
lsmod
, what is the reference count for the bluetooth module? Also,just to make sure there aren't other dependencies that may have been missed.
Eject modules in the following order:
Then try
What about disabling the module in /etc/modprobe.conf or blacking listing under /etc/modprobe.d/blacklist and then just rebooting?
Does something map to a /dev device and you could use lsof on that?
I think you have already tried the normal options...