LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 10-06-2011, 05:04 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,604

Rep: Reputation: 51
'rmmod -a' : what does it do?


Hi: In my system, the rmmod manual says:

Code:
SYNOPSIS
       rmmod [-f]  [-w]  [-s]  [-v]  [modulename]
And in /etc, I have:
Code:
semoi@darkstar:/etc/cron.hourly$ cat kmod
#!/bin/sh
/sbin/rmmod -as
semoi@darkstar:/etc/cron.hourly$
The manual does not say what rmmod does when it is invoked without an argument. And the -a option is undocumented. Can somebody supply missing information? Thanks in advance.
 
Old 10-06-2011, 05:13 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,235

Rep: Reputation: 302Reputation: 302Reputation: 302Reputation: 302
Looking at the source it removes all unused modules:

Code:
    /* Parse command line. */
    n = getopt32(argv, "wfas"); // -s ignored
    argv += optind;
   
    if (n & 1)  // --wait                         
        flags &= ~O_NONBLOCK;                     
    if (n & 2)  // --force
        flags |= O_TRUNC;
    if (n & 4) {
        /* Unload _all_ unused modules via NULL delete_module() call */
        if (bb_delete_module(NULL, flags) != 0 && errno != EFAULT)
            bb_perror_msg_and_die("rmmod");
        return EXIT_SUCCESS;
    }
 
Old 10-06-2011, 06:35 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,604

Original Poster
Rep: Reputation: 51
Thanks very much. Then in my system, every unused module is unloaded say at 6am, at 7am, at 8am and so on. However, if I do lsmod, I see all ALSA modules are loaded. These are loaded at boot time, but afterwards no other module or program uses them. I will exit the GUI and stay out of it for an hour and see what happens.
 
Old 10-06-2011, 01:54 PM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,235

Rep: Reputation: 302Reputation: 302Reputation: 302Reputation: 302
I'm curious where that kmod script came from. I don't have it on my 13.37 boxes.
 
Old 10-06-2011, 08:09 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,604

Original Poster
Rep: Reputation: 51
It gets installed in /etc/cron.hourly every time I install slackware 12.0. It's in the module-init-tools package (module-init-tools-3.2.2-i486-3.tgz), belonging to the A series.
Code:
PACKAGE LOCATION: /var/log/mount/slackware/a/module-init-tools-3.2.2-i486-3.tgz
PACKAGE DESCRIPTION:
module-init-tools: module-init-tools (kernel module utilities)
module-init-tools:
module-init-tools: Utilities to load and unload kernel modules.  These are used 
on Linux
module-init-tools: to load extra drivers or other features into the running kern
el.
module-init-tools:
module-init-tools:
module-init-tools:
module-init-tools:
module-init-tools:
module-init-tools:
module-init-tools:
FILE LIST:
./
bin/
etc/
etc/cron.hourly/
etc/cron.hourly/kmod
etc/modprobe.conf.new
...................
 
Old 10-07-2011, 07:36 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,235

Rep: Reputation: 302Reputation: 302Reputation: 302Reputation: 302
It seems to have been removed at some point then.
 
Old 10-08-2011, 03:10 AM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,604

Original Poster
Rep: Reputation: 51
After boot, I have 20 sound modules loaded. Do you know some easy way to unload them all?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
modprobe -r or rmmod rosv Linux - General 2 07-20-2009 10:39 AM
rmmod error shin2011 Linux - Newbie 2 12-02-2008 07:42 PM
help with insmod and rmmod jaepi Programming 21 05-28-2007 09:42 PM
rmmod -f not working R0UTE Linux - Software 0 10-27-2004 09:12 AM
Why can't I use lsmod rmmod etc JohnSharp Linux - Newbie 4 04-08-2004 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration