May 2012
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  
91

Refs

Categories

Archives

Getting Autofs and OpenVZ to Play Nice on CentOS 5

I recently ran into a problem where I was running the automounter inside an OpenVZ container (VE) while also running it on the Host Node (HN). The problem was with the HN and the automount command that’s part of the autofs package. Automount was getting confused by the fact that my OpenVZ containers already had automount running and was fooling it into thinking that is was already running on the HN. Seemed like a simple problem but after about an hour I was really scratching my head.

So off I went to look through the autofs forums and the autofs wiki to see if anyone had this solved. And in typical open source fashion the autofs guys already had a fix in that added a switch to automount basically turning off the “already running” check.

I found this link which made mention of a patch that overrides the running check. I backed off the URL of this patch until I found a tarball for autofs 5.0.4 which included this patch.

No rpm existed for CentOS 5 so I rolled my own using the above tarball. This version of autofs has an additional command line switch on the automount command called -C.

automount –help:

...
        -C --dont-check-daemon
                        don't check if daemon is already running
...

You can make this switch permanent by adding/editing this line in the /etc/sysconfig/autofs file:

1
OPTIONS="-C"

Now every time /etc/init.d/autofs is start/stopped it will no longer get confused by the potentially already running automounter processes inside the OpenVZ containers.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>