gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gluster-devel] Architecture-dependent directories


From: Hak Mem
Subject: [Gluster-devel] Architecture-dependent directories
Date: Thu, 30 Apr 2009 02:28:12 -0400

Hi -

In the really old days of AFS we used to have  architecture dependent
directories - this would map
cd /afs/foo/bar/@sys/toto to ---> cd /afs/foo/bar/i386_linux/toto

I was wondering what the chance of incorporating this on GlusterFS
was? This would not only be very cool but also make glusterfs very
very useful especially for user files (so dot files can go in the
right places) and also development purposes and production rollouts.

This would have to go on the client side process.  Any ideas?

-h

From: 
http://it.physto.se/?invoke=20-AFS//10-user_guide.php&invoketext=/user_guide#ARCH


AFS has been designed to be usable on machines of different system
flavors and even CPUs with different instruction sets. Consequently,
users working on machines of different architectures are faced with
the need of having to compile programs several times, and often to
store them in appropriately named places so that surrounding
applications which are common to all architectures, e.g. shell
scripts, can easily locate them.

To this effect AFS introduces the special address@hidden If used as the
last characters of any but the last element of a path name (in other
words, it is followed by a slash!), it will automatically be replaced
by the current AFS architecture string.

Example: on a PC Linux box running RedHat7.3 the path $HOME/address@hidden/bin
is equivalent to $HOME/.i386_redhat73/bin. The same path name
$HOME/address@hidden/bin on a Mac OS X system would automatically translate
into $HOME/.ppc_darwin_60/bin. This can be used to access programs for
different architectures under thesame name regardless of the
architecture, e.g. by setting up a directory per architecture and
appropriate symbolic links:

> cd
> mkdir -p .alpha_dux40/bin
> mkdir -p .i386_redhat90/bin
>address@hidden/bin bin

Now the following works on both Solaris and Linux, with nobody
"stepping on the other's feet":

on Solaris:

> cc -o bin/helloworld helloworld.c

on Linux:

> cc -o bin/helloworld helloworld.c

on both:

> bin/helloworld

The architecture string is compiled into the AFS kernel and varies
according to the processor type and operating system characteristics.

The architecture string for the machine you are working on can always
be queried with the fs sysname command.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]