Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Service control scripts & autofs

Status
Not open for further replies.

tech84

Technical User
May 18, 2000
126
US
I ran into another confusing glitch tonight.

I'm playing around with autofs, and configuring the auto_home indirect map to automatically mount a user's home directory upon logging in to the system. I added the user's home directory in /etc/auto_home and su - as the user I created. But I got an error stating "No Directory!" I was confused because the automountd daemon was running. So I ran /etc/init.d/autofs start. Now when I su - as the new user, it worked!

So this got me to looking into the service control scripts. In /etc/rc2.d, there is S74autofs, which leads me to believe that autofs should already be started. Why is it not started, even though I'm in run level 3? Does it have anything to do with the fact that there are two more service control scripts with the same starting number? (S74syslog & S74xntpd) I felt pretty comfortable with the whole inittab startup thing up to this point, but now I'm confused!

Thanks in advance for any light you can shed on this for me! Mike
[morning]
 
it should do, no there is no problem in sharing numbers.

maybe it was just a little glitch.

did the users exist before, did you try going to their home directory before you added to auto_home, did it used to point at a different mount point? ...

you could have tried typing 'automount' to reinstate the automount daemon ...
 
I had already created the user, but had not logged in as that user yet. The /export/home/username directory was there, but not the /home/username directory. Once I started autofs and logged in as the user, the /home/username directory was created.

I think you're right... had I run automount, it may have set things straight.

Thanks! Mike
[morning]
 
was this the first user added to the system? it might not have started the automountd properly if it was ...
 
I created the user right before I set up the indirect map. Then ran su - to log in as the new user. I was logged in as root at the time.

Later in the day, after I shut the machine down and powered it back up, I was able to log in as the new user from the logon prompt w/o any problems. The map was created and everything. It must have just been a one time glitch?

jad, what is your thinking on automountd not starting properly?

Thanks Mike
[morning]
 
You always need to run automount [ -v ] after updating those files for it to take effect. Annihilannic.
 
i haven't had too ... maybe i'm just lucky :)
 
On subsequent attempts at creating these indirect maps, I did run automount -v, and didn't have any problems. I was like jad, though... I didn't think you had to run anything for indirect mappings. I was under the impression that the automountd daemon mounted the resource at the time it was accessed. But whatever works!

Thanks! Mike
[morning]
 
matters what the string in your auto_master file says i guess ...

do you have a -nobrowse in there on the auto_home line?

if you do then it _could_ be that it doesn't map the direcories unless it needs them, so will let you mount them without 'automount' ...

maybe :)
 
Yep, I have the -nobrowse statement in my auto_home line.

Ha! I just figured out what the problem was! [surprise]

In my /etc/auto_home file, I added the mappings for my new users after the +auto_home statement. I moved that statement underneath the mappings I added (where I think it's supposed to be?) and now I have no problems with indirect maps. I don't even have to run automount -v or anything.

Thanks a lot for your help! I think I finally got this issue licked. Mike
[morning]
 
we have the +auto_home at the top, but we use NIS+, so we need it there ... i guess if you don't have nis, nisplus or any other naming convention you probably don't need to worry about that line :)
 
Okay, here's a new twist on this topic:

on my nfs server, I have in the /etc/dfs/dfstab file:

share -F nfs -d "sample share" /opt/Netscape
share -F nfs -o rw -d "Home Folders" /export/home


But when I boot up the server and type "share" it only shows the /opt/Netscape folder as being available. Not until I type "shareall" does the /export/home folder show up on the list.

Any ideas? Mike
[morning]
 
do you have a shareall command in your /etc/init.d/nfs.server command?

someone could have modified it to share specific shares ... maybe.
 
I'm the only one who uses this system, so the /etc/init.d/nfs.server file should be straight out of the box. I looked at it anyway, and it looks good to go. I'm having trouble understanding the purpose of the /etc/dfs/sharetab file. Even though I'm sharing two resources, and they're both mounted by an nfs client right now, the sharetab file is still empty. Is that a file that's automatically populated by the system, or am I supposed to edit it? According to the man page on sharetab, it looks like it should be populated by the system automatically. Should I delete/recreate this file or something?

Thanks! Mike
[morning]
 
it's automatic ... used for working out which shares are used ... i believe :)

no, you're not sposed to edit it :)

if you can live with automount, it might just be easier to do that ... sorry :)
 
Oh boy. I finally got to the bottom of this issue.

I tried a little experiment by adding another share to the /etc/dfs/dfstab file. Low and behold, my /export/home folders were being shared at startup now! But not the new share I just added. So a tiny light bulb went off, and I put a carriage return at the end of the last share. Previously, I just left the cursor at the end of the line(s) I added, and saved the file. This time I hit Return after I entered the last line into the dfstab file, and it worked! Now all of the shares in the /etc/dfs/dfstab file are automatically shared at startup. I guess it needed that carriage return to see the whole line or something. Who would have thought? Not me.

Also, I figured out the deal with the /etc/dfs/sharetab file... why I didn't see anything in it even though I had shares happening. The deal was that I couldn't see anything in the file if I double-clicked on it in the File Manager window. If I viewed it using the cat command, there were my shares!

I guess every day I learn a little something new. This is fun!!

Thanks! Mike
[morning]
 
Oh, no! What editor are you using, not some horrible GUI one like xedit? They are infamous for not terminating the last line with an LF. Use vi! ;-) Annihilannic.
 
ik ... someone editing system files with GUI?

--
Jad's system undergoes cut-and-paste error death ... AHHHHHHHHHHHH!
--

I use vi ... you can also fix problems over a serial connection if needed with vi :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top