Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hey, I'm wondering if there's a way to get certain modules that are loaded up when something starts (for example, XFree) to unload when that application or whatever is terminated.
For example...when I start XFree, I know that the radeon module is loaded to handle the graphics, etc etc. however if I shut down XFree, the radeon module stays there even though I don't need it anymore. Or if I put in my USB memory stick and use it, and then unmount it and take it out...the modules needed for the USB stick remain loaded and don't go away unless I unload them myself.
Is there a way to make these unneeded modules unload automatically? It seems like Kmod is supposed to do something like that, but I have no idea how to get it to work and haven't been able to find any information on it...I know it's enabled in the kernel but I don't see it doing anything on its own and I don't know how to configure it, or whatever you have to do. Any suggestions or pointers to somewhere that could help me?
Why would you be concerned about the loaded module anyway?
I would think something like hotplug would indeed do what it is you are talking about, at least for the memory stick portion, but the radeon, well the hardware is still going to be attached, so I can't imagine it would take care of that as well. However, I would think that depending on how you call X and stop X you might be able to attach a string to rmmod the radeon module during the kill. You could probably also write a small script to check if X is running using something like ps, and when it returns a 1 meaning X is no longer running, it can then unload the module. But that's a bit in depth for something so trivial, IMHO.
I guess if RAM is hard to come by, sure. I'm not sure that the modules load up RAM, but if they do, and that is a concern for you (they are tiny, but if your RAM is as well, then...) then unloading them sounds good to me
When you unplug the stick, does hotplug recognize it (in the logs)? With hotplug running, when I remove my PCMCIA Wireless card, the modules are then removed that keep it running, but maybe that's the workings of pcmcia and not necessarily USB.
kmod should/does remove un-necessary modules, but I believe that's only at a certain interval, maybe every 10 minutes or so?
I'm sure 2.6.7 is mature enough to have the capability of doing that. My 2.4.x running Gentoo does, but again, I'm not sure of the process that unloads the module, kmod or hotplug or possibly something else...
thanks, just somethin about building up more and more uneeded modules as i do things that kinda irks me....but i dunno if it's a big deal, that's just me....
is kmod kind of an automatic thing or do you have to configure it? that's what i can't really figure out...i know i enabled support for automatic module loading when i recompiled my kernel and all
but thanks for the help at any rate
actually I have one unrelated question, if i can hijack my own thread for a second...
when you're copying files at the command line, how do you do it if the file you're copying has spaces in it? for example, i have some documents from my windows PC that i wanted to move over to my linux pc via my USB key. the name of the document has spaces in it...using normal copying commands i wasn't able to get it to work (though maybe i just needed to play with it more) is there some trick i'm missing?
You can use quotes around the spaced filename:
cp "My Cool Huge File that I wrote.doc" /home/documents
OR, you can TAB TAB TAB to get the autocomplete to do it the more correct way:
cp My\ Cool\ Huge\ File\ that\ I\ wrote.doc
Hit tab after typing My in the directory where the file is located.
I just, as in 30 seconds ago, configured a 2.6.9 kernel, and in the modules section, there is an option for module unloading, and it may be the answer you are looking for, it's worth a shot anyway.