FF & varsym

Francis Gudin fgudin at nerim.net
Sat Jul 28 10:47:55 PDT 2007


I just tried playing a bit with varsym. The idea is to have a
"production" /usr/pkg and /var/db/pkg, and another environment for
upgrades. I did the following:

- enabled varsym support (/etc/sysctl.conf: vfs.varsym_enable=1)
- defined my pkgsrc switch (/etc/varsym.conf: PKGSRC_SWITCH=_28072007)
- renammed /usr/pkg and /var/db/pkg to /usr/pkg_28072007 and
- created two varsym links:
  ln -s 'pkg${PKGSRC_SWITCH}' /usr/pkg
  ln -s 'pkg${PKGSRC_SWITCH}' /var/db/pkg

Now, I couldn't launch Firefox anymore. It seems to play with lstat(2)
and things go wrong. Here's a excerpt with truss:

lstat("/usr/pkg",0xbfbfe080)                     = 0 (0x0)
readlink("/usr/pkg","pkg${PKGSRC_SWITCH}",1023)  = 19 (0x13)
lstat("/usr/pkg${PKGSRC_SWITCH}",0xbfbfe080)     ERR#2 'No such file or directory'

Another data from ktrace:
 1351 firefox-bin NAMI  "/usr/pkg"
 1351 firefox-bin RET   readlink 19/0x13
 1351 firefox-bin CALL  lstat(0xbfbfeea0,0xbfbfdd30)
 1351 firefox-bin NAMI  "/usr/pkg${PKGSRC_SWITCH}"
 1351 firefox-bin RET   lstat -1 errno 2 No such file or directory

This seems weird to me: userland should not know about varsym content
(except for those programs that explicitly deal with it, through
varsym_* system calls, of course), and instead should be given an
"interpreted" path, should they ?

Any enlightenment much appreciated :-)


More information about the Users mailing list