LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 10-21-2013, 12:13 AM   #1
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 184

Rep: Reputation: 35
modprobe/rmmod on application startup/exit


Sup. This seems like something very simple to do that I should already know but I've never done it before. Basically when running VMWare Player, I want to auto modprobe vmmon, vmci, vmnet when starting it and rmmod them when I exit.

How do I do this? Thanks.
 
Old 10-21-2013, 02:34 AM   #2
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,159

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
https://www.linuxquestions.org/quest...n-boot-199457/
 
Old 10-21-2013, 02:43 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,743
Blog Entries: 54

Rep: Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972Reputation: 2972
...or you could move the script or binary that starts VMWare Player to another name then encapsulate the commands in a script:
Code:
#!/bin/bash --
_svc() {
  case "$1" in
   start) ACTION=modprobe;; 
    stop) ACTION=modprobe;;
       *) exit 1;;
  esac

for LKM in vmmon vmci vmnet; do
 $ACTION $LKM || exit 1
done
 } # End of _svc

_svc start
/path/to/vmwareplayer
_svc stop

exit 0
 
1 members found this post helpful.
Old 10-21-2013, 04:01 AM   #4
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 184

Original Poster
Rep: Reputation: 35
Quote:
Originally Posted by unSpawn View Post
...or you could move the script or binary that starts VMWare Player to another name then encapsulate the commands in a script:
Code:
#!/bin/bash --
_svc() {
  case "$1" in
   start) ACTION=modprobe;; 
    stop) ACTION=modprobe;;
       *) exit 1;;
  esac

for LKM in vmmon vmci vmnet; do
 $ACTION $LKM || exit 1
done
 } # End of _svc

_svc start
/path/to/vmwareplayer
_svc stop

exit 0
Interesting. I might give this a shot later. Thanks.
 
Old 10-21-2013, 04:52 AM   #5
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,673

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
I do it that way:
  1. At end of /etc/rc.d/rc.local, add following lines:
    # Modules needed by vmplayer
    modprobe vmmon
    modprobe vmci
  2. type this as root:
    chmod +x /etc/rc.d/rc.{local,sysvinit}
After booting, vmplayer is ready.

rc.sysvinit should be executable because that's what vmplayer uses.

PS doing things that way modules are not unloaded when you quit vmplayer, but if you are short enough in RAM to care for that, you don't have enough RAM to run vmplayer anyway, so that doesn't hurt at all

Last edited by Didier Spaier; 10-21-2013 at 05:11 AM. Reason: Indicate absolute path of rc.local
 
  


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 11:39 AM
udevd-event [1410]: run_program: '/sbin/modprobe' abnormal exit SHENGTON Linux - Laptop and Netbook 0 11-27-2008 07:25 AM
'/sbin/modprobe' abnormal exit ShadowHywind Linux - General 4 08-20-2008 03:54 PM
modprobe on startup paull2k1 Mandriva 3 06-27-2005 03:27 PM
Hotkey for application exit? xanas3712 Linux - Newbie 1 10-16-2004 10:16 PM


All times are GMT -5. The time now is 08:45 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration