LinuxQuestions.org
Register a domain and help support LQ
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 12-24-2012, 11:44 PM   #1
s_siouris
LQ Newbie
 
Registered: Nov 2004
Distribution: Scientific Linux 6.4
Posts: 22

Rep: Reputation: 0
re-read modified /usr/share/Modules/init/.modulespath


Hi all,

I want to add my own directory for modulefiles, such as /usr/local/share/Modules/modulefiles, and I am doing this by adding this directory in the text file /usr/share/Modules/init/.modulespath.

My problem is that when I do "module avail", it does not show the modulefiles of the new directory unless I reboot the system. What command can I run so that /usr/share/Modules/init/.modulespath is re-read without needing to reboot?


Many thanks,
Spiros
 
Old 12-25-2012, 03:41 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
If you want to have some modules read and loaded by the init at boot up the place where init looks into it is /etc/modprobe.d directory. Put everything you like there; at successful boot and load the modules are already reckoned by the system.

Hope that helps. Good luck.

Last edited by malekmustaq; 12-25-2012 at 03:42 AM.
 
Old 12-25-2012, 10:01 AM   #3
s_siouris
LQ Newbie
 
Registered: Nov 2004
Distribution: Scientific Linux 6.4
Posts: 22

Original Poster
Rep: Reputation: 0
Thanks for the reply. I can get things to work with a reboot, but my problem is I cannot figure out how to reload the .modulespath without reboot. Do you have any ideas on how to do this without reboot? I want to do this on a server so restarting the system is not an option unfortunatelly.

Thanks,
Spiros

Last edited by s_siouris; 12-25-2012 at 10:29 AM.
 
Old 12-25-2012, 12:43 PM   #4
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
Use modprobe to insert or remove modules without need to reboot.

Code:
~$ modprobe -h
~$ man modprobe
That is what you are looking for.

Hope that helps.

Good luck.

m.m.

Last edited by malekmustaq; 12-25-2012 at 12:45 PM.
 
Old 12-25-2012, 01:05 PM   #5
s_siouris
LQ Newbie
 
Registered: Nov 2004
Distribution: Scientific Linux 6.4
Posts: 22

Original Poster
Rep: Reputation: 0
Thanks for your help!

Sorry but I was probably not clear enough. The modules I am refering to are for loading environment variables using the
Code:
module
command, and not kernel modules. When you type
Code:
module avail
in the shell, you ahould get something like:
Code:
------------------------ /usr/share/Modules/modulefiles ------------------------
dot           module-info   mpich2-x86_64 use.own
module-cvs    modules       null

I want to add my own additional directory where "module" searches, for example /home/spiros/Modules/modulefiles, so that when typing "module avail" it will list something lie this:

Code:
------------------------ /usr/share/Modules/modulefiles ------------------------
dot           module-info   mpich2-x86_64 use.own
module-cvs    modules       null
------------------------ /home/spiros/Modules/modulefiles ------------------------
my-own-modulefiles
To do this I need to add the /home/spiros/Modules/modulefiles directory to /usr/share/Modules/init/.modulespath but in order for the changes to take effect, I can only do this by rebooting. Is there a service I can stop/start, or any other command, so that the module command can re-read the /usr/share/Modules/init/.modulespath file without reboot?


Many thanks for your time,
Spiros
 
Old 12-26-2012, 12:21 AM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
Ah, I see, am sorry. It means you are using 'module' package.
Have you tried these already? --

Code:
module load
module add
module remove
module rm
If not then try
Code:
module help
If it is not about heavy duty tasks you can set your environment (e.g. $PATH) permanently at /etc/profile or $HOME/.bash_profile using "export", at least they are loaded automatically. You can fix that module path by exporting in the /$HOME/.bashrc or defining there your path, e.g. "PATH=$HOME/modules/path:$PATH" by this you are adding automatically your modules path into your basic bash $PATH. You can also create your own bin folder /$HOME/bin and put there a simple script that carries 'module' command to load and unload certain environments at will without need of rebooting.

Hope that helps.

Good luck.
 
  


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
diff in kernal modules init code when build as a part of kernal and as modules? ReshmiS Linux - Kernel 1 11-25-2009 12:21 PM
Linux Share being able to be "read" within windows, but cannot be modified. Elder_Usr Linux - Newbie 2 11-07-2009 03:44 AM
/usr/share sulekha Ubuntu 2 12-30-2008 09:58 AM
Example share in smb.conf doesn't work - read/write vs read only kleptophobiac Linux - Networking 0 09-01-2004 08:14 PM
php read file creation, modified date problem antony_csf Programming 3 08-18-2004 07:46 AM


All times are GMT -5. The time now is 10:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration