[comp.unix.questions] hard linked symlinks

phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) (03/24/91)

Does anyone see any technical problems with having a single inode for
a symlink, linked to under several different names?

The symlink does NOT point to a directory, it points to a file.
All of the links to the one symlink are in the same subdirectory,
for convenience.

The purpose is to have ONE command (rsh) executed under a number of
different names (various host names).  The rsh command is on a different
filesystem than the subdirectory, so a symlink is required.

The alternative was to have separate symlinks under each name, but that
appeared to be consuming a data block for each one to store the name
the symlink was pointing to.  I wanted to conserve some space.

Unlink directories, the hardlinked symlinks are easily removable.

One of the anticipated problems is that backup/restore and/or
archive/extract of them will fail.  I probably can live with that
as long as it does not cause something to crash, rather just fail
to restore the links.

Comments?
-- 

 /***************************************************************************\
< Phil Howard -- KA9WGN -- phil@ux1.cso.uiuc.edu                              >
 \***************************************************************************/

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (03/26/91)

In article <1991Mar24.000253.9515@ux1.cso.uiuc.edu> phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes:
> Does anyone see any technical problems with having a single inode for
> a symlink, linked to under several different names?

Sure: it changes the semantics of ln -s foo bar; ln bar blah; rm bar.

> The alternative was to have separate symlinks under each name, but that
> appeared to be consuming a data block for each one to store the name
> the symlink was pointing to.  I wanted to conserve some space.

Then you should be asking for symlinks stored in the directory file
rather than in separate fragments.

---Dan

rbj@uunet.UU.NET (Root Boy Jim) (03/28/91)

In article <1991Mar24.000253.9515@ux1.cso.uiuc.edu> phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes:
>Does anyone see any technical problems with having a single inode for
>a symlink, linked to under several different names?

Symlinks aren't implemented that way.

>The purpose is to have ONE command (rsh) executed under a number of
>different names (various host names).  The rsh command is on a different
>filesystem than the subdirectory, so a symlink is required.

True.

>The alternative was to have separate symlinks under each name, but that
>appeared to be consuming a data block for each one to store the name
>the symlink was pointing to.  I wanted to conserve some space.

The space used is negligible.

However, could always put rsh in /usr/hosts with as many links
as you like, and put the symlink into /usr/ucb.

	rm -f /usr/hosts/*
	cd /usr/ucb
	mv rsh /usr/hosts
	ln -s  /usr/hosts/rsh .
	cd /usr/hosts
	ln rsh foo
	ln rsh bar
	...

-- 
		[rbj@uunet 1] stty sane
		unknown mode: sane