Skip to contentSkip to conversation

Removing a module even if use count is not zero

DISCUSSION selvakumar nagendran 4 participants 5 messages Jan 12, 2005 – Jan 13, 2005

lore
Share & tools
lore
#0 lore raw

hello linux-experts,
I inserted my module into the running kernel that
intercepts read system call. I am using kernel 2.4.28. Now, I am unable to remove it since each and every time, the module is used by some process. How can I remove the module even if the usecount is not zero?
Can anyone help me regarding this?

Thanks,
selva

__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo

#1 lore raw
Quoted 11 lines · selvakumar nagendran

hello linux-experts,
I inserted my module into the running kernel that
intercepts read system call. I am using kernel 2.4.28. Now, I am unable to remove it since each and every time, the module is used by some process. How can I remove the module even if the usecount is not zero?
Can anyone help me regarding this?

Thanks,
selva

Reboot. If you remove it, the system will likely crash.

--
Brian Gerst

#2 lore raw
In reply to selvakumar nagendran
Quoted 7 lines · selvakumar nagendran

hello linux-experts,
I inserted my module into the running kernel that
intercepts read system call. I am using kernel 2.4.28. Now, I am unable to remove it since each and every time, the module is used by some process. How can I remove the module even if the usecount is not zero?
Can anyone help me regarding this?

As already said, you need to reboot.

To fix this in the future, export a /proc entry that when written to causes your module to properly clean everything up and prevent anyone from getting new accesses. This then allows you to remove the module cleanly. Note that it may not be possible to cleanly deregister, depending on what your module is doing.

Chris

#3 lore raw

exporting /proc entry for module

Quoted 11 lines · --- Chris Friesen

To fix this in the future, export a /proc entry that when written to
causes your module to properly clean everything up and prevent anyone
from getting new accesses. This then allows you to remove the module
cleanly. Note that it may not be possible to cleanly deregister,
depending on what your module is doing.

Chris

How can I export a /proc entry for my module?

Regards,
selva

__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com

#4 lore raw

Re: exporting /proc entry for module

Quoted 10 lines · selvakumar nagendran
Quoted 6 lines · --- Chris Friesen

To fix this in the future, export a /proc entry that
when written to causes your module to properly clean everything up and prevent anyone from getting new accesses. This then allows you to remove the module cleanly. Note that it may not be possible to cleanly deregister, depending on what your module is doing.

How can I export a /proc entry for my module?

. . . . . . . . . .

You can study the valuable documents at
http://kernelnewbies.org/documents/

or google for other procfs example source code,
which should find several examples for you,
such as http://www.xenotime.net/linux/procfs_ex/

Signature · 1 line
~Randy