On Wed, Apr 20, 2011 at 02:37:00PM +0200, Florian Haas wrote:
> On 2011-04-20 11:41, Dominik Klein wrote:
> > Hi
> > 
> > I wrote a new RA that can manage a symlink.
> > 
> > Configuration:
> > 
> > primitive mylink ocf:heartbeat:symlink \
> >     params link="/tmp/link" target="/tmp/target" \
> >     op monitor interval="15" timeout="15"
> > 
> > This will basically
> > ln -s /tmp/target /tmp/link
> > 
> > hth
> > Dominik

There used to be something called "drbdlinks".  Never really looked at
it, though, so I'm not sure what exactly it does or does not do.

In any case I suggest using
ln -nvsTf, and add comments as to why.

the -n is in case it points to a directory already.

try this:

        mkdir symlink-test
        cd symlink-test
        mkdir a
        mkdir b

        ln -sv b current
        # (outch)

        ln -nsvf b current
        # (better now)

        rm current
        mkdir current

        ln -nsvf b current
        # (outch)

        ln -nsvfT b current
        # (better now, at least cleanly errors out)

Not sure about the portability of all those flags.
Not sure about security implications
(symlink races in world writeable directories)

Maybe you want to at least allow (or even default) to enforce certain
permissions (root:root 0755 as a minimum?) on the directory the symlink
is located in?
Maybe nothing can go wrong anyways?

        Lars
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to