LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-11-2013, 03:57 PM   #1
flyinggeorge
Member
 
Registered: Feb 2012
Location: United States
Distribution: Slackware 14.0
Posts: 159

Rep: Reputation: 3
Question about modprobe and blacklist


Hello there! I'm asking this question mostly because I do not know exactly how to go about getting the answer.

This isn't a problem, really, but when I boot my system modprobe automatically loads 'psmouse' module for the touchpad on my laptop. Which is great, and would be really great if I didn't happen to have a wireless mouse around. I personally find that the touchpad gets in the way and I've always just used rmmod to remove the psmouse module. So my question is, if I were to blacklist the psmouse module, would I be able to load with modprobe? It seems like blacklisting the module is too permanent of a solution. Is there a way that I can prevent psmouse from loading on boot but still be able to modprobe it later if needed?
 
Old 07-11-2013, 04:03 PM   #2
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
You could unload the module upon login:

Code:
modprobe -r psmouse
If you want to do that without having to type a password put the above command in a script and put it into e.g. /usr/local/bin editable only by root.
Then allow the script to be executed by the standard user with sudo by setting the NOPASSWD flag in the sudoers file. (use
Code:
visudo
to edit that file.)
Then you could put the call to that script in your autostart script.
You could then also assign a keyboard shortcut to that script to be able to easily switch the touchpad on and off

Last edited by joe_2000; 07-11-2013 at 04:04 PM. Reason: spelling
 
Old 07-11-2013, 04:06 PM   #3
flyinggeorge
Member
 
Registered: Feb 2012
Location: United States
Distribution: Slackware 14.0
Posts: 159

Original Poster
Rep: Reputation: 3
That's basically what I am doing now, although I had not considered adding modprobe -r or rmmod to any startup script.

Is there any other way to tell modprobe to not load that particular module on boot? Other than blacklist. Again, this isn't really a problem or anything, but curious minds would like to know.

I also don't keep my user in the sudoers file. I don't see much need to since I am the only user of this machine. Plus if someone got on this box it would be easier to get my user password than my root password I would imagine. So why give them the option of sudo -l or sudo su?

Edit* If I take psmouse.conf out of /lib/modprobe.d will udev still load it at boot time? Or am I misunderstanding the process? Also this wouldn't stop me from probing the module (modprobe psmouse) would it?

Last edited by flyinggeorge; 07-11-2013 at 04:56 PM.
 
Old 07-11-2013, 05:56 PM   #4
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
Quote:
Originally Posted by flyinggeorge View Post
Is there any other way to tell modprobe to not load that particular module on boot? Other than blacklist. Again, this isn't really a problem or anything, but curious minds would like to know.
Hmm, I understand that, but sorry, don't know.

Quote:
Originally Posted by flyinggeorge View Post
I also don't keep my user in the sudoers file. I don't see much need to since I am the only user of this machine. Plus if someone got on this box it would be easier to get my user password than my root password I would imagine. So why give them the option of sudo -l or sudo su?
Hmm, I don't know why it would be easier to get your user then root password. Note by the way that someone who has physical access to your machine can hack it in 2 minutes anyhow. You can just modify a boot paramater in grub (from the grub boot screen) and boot into a password-free root shell. If you want to keep people with physical access away from your machine you have to use other means than just disabling sudo.

I use sudo mainly to make commands password-free which would otherwise require root privileges. That enables me to conveniently call them from startup scripts and/or keyboard shortcuts. Obviously this should not be done with commands that could modify your system, but I think unloading the touch pad module should be ok...
 
Old 07-11-2013, 06:47 PM   #5
flyinggeorge
Member
 
Registered: Feb 2012
Location: United States
Distribution: Slackware 14.0
Posts: 159

Original Poster
Rep: Reputation: 3
I see what you mean about the sudoers file. I don't think I need to worry about anyone gaining access to my box as I live alone and none of my friends are linux savvy. I had just assumed (based on nothing of course ) that if someone were to use a net-based attack they would probably get into my user since I never log in as root unless I need to do something. On the other hand I have no idea how root kits work or anything like that, so you are probably right.

I'm not going to mark this solved yet, just in case anyone has any ideas that haven't already been stated. Thank you for your input, joe
 
Old 07-12-2013, 04:18 AM   #6
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
I was just thinking of one more thing, which still is no direct answer to your question but may be useful to your original problem.

Have you used syndaemon yet? It locks your touchpad while typing. Again something you might want to put in your startup script:

Code:
syndaemon -d &
 
Old 07-12-2013, 04:58 PM   #7
flyinggeorge
Member
 
Registered: Feb 2012
Location: United States
Distribution: Slackware 14.0
Posts: 159

Original Poster
Rep: Reputation: 3
That is useful! Although you are correct, it's not exactly what I was looking for, that would probably work just as well. Still going to leave this thread open just in case anyone else knows anything. Thank you for your help, joe.
 
Old 07-12-2013, 05:10 PM   #8
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
You are welcome :-)
 
Old 07-13-2013, 02:34 AM   #9
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Rep: Reputation: Disabled
I think you may want to check out /etc/X11/xorg.conf or /etc/X11/xorg.conf.d/. See if you have a synaptics input file in that directory or any other file related to input like evdev.conf or something. I believe on my distro I would just comment out <MatchIsTouchpad "on"> or change it to "off" but it could vary by distro. I believe that would be the most appropriate way to disable your touchpad.
 
Old 07-13-2013, 02:41 AM   #10
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Rep: Reputation: Disabled
Quote:
Originally Posted by flyinggeorge View Post
That's basically what I am doing now, although I had not considered adding modprobe -r or rmmod to any startup script.

Is there any other way to tell modprobe to not load that particular module on boot? Other than blacklist. Again, this isn't really a problem or anything, but curious minds would like to know.

I also don't keep my user in the sudoers file. I don't see much need to since I am the only user of this machine. Plus if someone got on this box it would be easier to get my user password than my root password I would imagine. So why give them the option of sudo -l or sudo su?

Edit* If I take psmouse.conf out of /lib/modprobe.d will udev still load it at boot time? Or am I misunderstanding the process? Also this wouldn't stop me from probing the module (modprobe psmouse) would it?
If you actually have a psmouse.conf file and it's responsible for loading the psmouse module then you should be able to remove the file to solve your problem. I would only remove it if it has something simple in it like the name of the module and only that. If it has alot of extra text in it then I would just look through it and comment out the part that loads the psmouse module. I don't have a psmouse.conf yet the module still loads on my system so if that doesn't work then you may in fact need to stop the touch pad from loading through a file in the /etc/X11/xorg.conf.d/ directory. My guess is that evdev or the synaptics input driver loads the module in a method that I can only control the the xorg.conf files.

Also, if you remove the file, you should still be able to load the module with modprobe later on. Even if you blacklist the module you could always load it with "insmod /lib/modules/`uname -r`/kernel/drivers/input/mouse/psmouse.ko.gz". You can even set that up as an alias. insmod operates at a lower level so blacklisting the module wouldn't prevent you from loading it with insmod.

Last edited by wstewart90; 07-13-2013 at 02:47 AM.
 
1 members found this post helpful.
Old 07-14-2013, 06:20 PM   #11
flyinggeorge
Member
 
Registered: Feb 2012
Location: United States
Distribution: Slackware 14.0
Posts: 159

Original Poster
Rep: Reputation: 3
Actually I took a look in the .conf file (should have done that before posting, silly me.) and it doesn't have any options in it. It just has some commented out examples of options. I think I will try blacklisting psmouse and using insmod with an alias to load it if need be. Thank you for the suggestion.

Edit: Just gave that a shot and so far it's working. I haven't rebooted (I see no need to at this time.) but modprobe psmouse returns "No such module: psmouse" which is good. Using the insmod command, I am able to load the psmouse module and can remove it as before with rmmod psmouse.

Last edited by flyinggeorge; 07-14-2013 at 06:28 PM.
 
  


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
[SOLVED] /etc/modprobe.d/blacklist.conf not working samac Slackware 4 03-30-2013 05:53 PM
[SOLVED] /etc/modprobe.d/blacklist in RHEL 4.5 linux_beginer Linux - Newbie 3 04-03-2011 02:11 AM
[SOLVED] Newbie SPAM Email blacklist question AndeAnderson Linux - Server 9 01-22-2010 12:32 PM
modprobe question ethyrdude Debian 2 11-17-2006 05:52 PM
?Odd bug. modprobe.blacklist~ behaves as modprobe.blacklist arubin Slackware 1 11-05-2006 08:08 PM


All times are GMT -5. The time now is 04:20 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