LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-23-2013, 09:39 AM   #1
Importepeu
LQ Newbie
 
Registered: Jul 2013
Posts: 5

Rep: Reputation: Disabled
[LPI preparation] Help regarding automount


Hi everybody,

I'm preparing the LPIC-2 exams. Usually I found answers to my questions on the Internet but I choose to register here today to find some experts that would help me to understand a question for which the answer not convince me.

Searching on the Internet, I found a test with this question :

"You have elected to use the automounter and the autofs script. Your /etc/auto.master file contains the following:
/home /etc/auto.home
/project /etc/auto.project
/data yp:data.map

If you change the contents of /etc/auto.project to include a new source path what must be done to access the new path?
A. Shutdown and restart the local NFS client daemons.
B. Run fsck on the affected mount point.
C. Issue the /etc/init.d/autofs reload command.
D. Add the newly mapped path to /etc/fstab.
E. Nothing, simply access the newly mapped resource."

Regarding the man page of autofs, it's written :
"Indirect maps can be changed on the fly and the automouter will recog-nize those changes on the next operation it performs on that map. Direct maps require a HUP signal be sent to the daemon to refresh their contents as does the master map."

Here, the question concern an indirect map, so the correct answer would be "E". But the answer to this question appears to be "C"... So I don't agree and understand why, regarding the man. Anyone could clarify please ?

Last edited by Importepeu; 07-25-2013 at 08:45 AM.
 
Old 07-23-2013, 12:29 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
autofs will consult a configuration file /etc/auto.master (see auto.master(5)) by default to find mount points on the system. For each of those mount points automount(8) will mount
and start a thread, with the appropriate parameters, to manage the mount point.

/etc/rc.d/init.d/autofs reload will check the current auto.master map against running daemons. It will kill those daemons whose entries have changed and then start daemons for new or
changed entries.

If a map is modified then the change will become effective immediately. If the auto.master map is modified then the autofs script must be rerun to activate the changes.


Technically this counts as modifying the auto.master because you are modifying one of the files it is including.
 
Old 07-23-2013, 12:56 PM   #3
Importepeu
LQ Newbie
 
Registered: Jul 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
That's the point! The question say that it's not the auto.master file that is modified but the contain of auto.project which then correspond to an indirect map, do you agree ?
So wouldn't it be the "If a map is modified then the change will become effective immediately" of man page which apply ?
 
Old 07-23-2013, 01:25 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
No, as stated your /etc/auto.master is what is read and the difference between an indirrect and direct map I think is where you are having problems. Any time you modify any of these files you need to restart or send a HUP signal to autofs.

The direct maps specifies a mount point on the client for a specific directory on the server. An indirect map refers to a table of automount points. Also, your question notes that the source path is being modified which would always require a restart.
 
Old 07-23-2013, 02:59 PM   #5
Importepeu
LQ Newbie
 
Registered: Jul 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for your answer Kustom42. Maybe you're right, I have some troubles to understand exactly the different configurations between direct and indirect maps. But (there's often a "but" ) I take a look to some tutorials and it's written that direct maps are always configured like this in master.map :
/- path_to_map_file

and in path_to_map_file you can find entries like this : /mnt/test hostname:/test

Indirect map are configured like this in master.map
/parent_directory path_to_map_file

and in path_to_map_file you can find entries like this : test2 hostname:/test2
this allow hostname:/test2 to be mounted in /paren_directory/test2

So, in my opinion, /etc/auto.project refers to indirect maps (cause there is no '/-' in master.map). The question talked about modification of /etc/auto.project and then, regarding the man, "Indirect maps can be changed on the fly and the automouter will recog-nize those changes on the next operation it performs on that map".

If I'm wrong (which is possible) can you explain me where ?
Thanks a lot.

Last edited by Importepeu; 07-23-2013 at 03:01 PM.
 
Old 07-23-2013, 03:19 PM   #6
Importepeu
LQ Newbie
 
Registered: Jul 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
I tried this on my linux workstation :

1) I configured auto.master like this (like /etc/auto.project in the question) :
Code:
/mnt/tom        /etc/auto.tom
2) I configured /etc/auto.tom like this :
Code:
bkp_brd         esx:/media/brd
3) I start service autofs and try to access /mnt/tom/bkp_brd. With success

4) I edited the /etc/auto.tom map file like this :
Code:
bkp_brd         esx:/media/brd
bkp_brd2         esx:/media/brd2
5) I didn't restart|reload autofs service

6) I tried to access /mnt/tom/bkp_brd2... with success

So my indirect map /etc/auto.tom was loaded on the fly as the man page explains. So I still don't understand the given answer of the question
It appears that tests found on the internet or even bought to some organisations are filled with some errors. Maybe it's an example of these ?

I'm still aware of your comment anyway

Last edited by Importepeu; 07-23-2013 at 03:23 PM.
 
Old 07-25-2013, 08:43 AM   #7
Importepeu
LQ Newbie
 
Registered: Jul 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Regarding the test, I can say that answer "E" is certainly correct and that answer "C" is wrong.
Unless someone bring a proof to contradict my opinion.
I put this post as "SOLVED".

Thanks again to Kustom42 for its participation which lead me to look deeper and do some tests.
 
  


Reply



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
Preparation for LPIC1 hanamilani Linux - Certification 1 06-23-2012 07:05 AM
Unable to Automount ISO image unless automount is running in foreground! swests Linux - General 4 05-22-2009 12:47 AM
CentOS 5.2 Automount isos in fstab \other methods that work?automount iso Frankly3D Linux - General 6 07-13-2008 12:34 PM
Which LPI 101 book is up-to-date, covers all objectives and passed the LPI ATM? Fred_ Linux - Certification 3 11-04-2007 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:15 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
Open Source Consulting | Domain Registration