Re: Idea: a way to use /dev/modem symlinks safely
On Sat 10 Apr 1999, Wichert Akkerman wrote:
> Previously Avery Pennarun wrote:
> > Here's my thought: rather than creating a lockfile for the filename of the
> > requested device (eg. /dev/modem --> /var/lock/LCK..modem) we can create a
> > lockfile for the target of the symlink (eg. /dev/modem --> /dev/ttyS2 -->
> > /var/lock/LCK.ttyS2).
> There has been some discussion about this on the FHS list, and the
> issue has recently come up again. The consensus seems to be to use
> a liblockfile which makes the lockfile using the real devicename,
> and perhaps a symlink with the other name as well.
FWIW I like the way SVR4 does it (one of the few things it gets right :-),
it uses the major / minor device number and the st_dev major number of
the fs containing /dev. That way it doesn't matter via what name the
device is referenced; it's the major and minor numbers that are important
here. The lockfile contains the pid of the locking process as "%10d\n"
home: email@example.com | work: firstname.lastname@example.org | debian: email@example.com
http://www.wurtel.demon.nl | Murphy Software, Enschede, the Netherlands