Strange behaviour of symlink /var

Solution 1:

I would probably start with two things.

  1. sudo -s
  2. Judicious use of file hopefully can help pick apart the error in thinking, permissions or execution here.

File should report correct results all the way back to root, and then all the way back to /private/var - once you’ve got a string of good results - repeat the sequence of file checks to test ../../var/whatever

# file ../../var/                                      
../../var/: directory
# file ../../var/com.twocanoes.tcscryptotoken.tcstoken/        
../../var/com.twocanoes.tcscryptotoken.tcstoken/: directory
# file ../../var/com.twocanoes.tcscryptotoken.tcstoken/token.sh 
../../var/com.twocanoes.tcscryptotoken.tcstoken/token.sh: POSIX shell script text executable, ASCII text

If you are on Catalina - realize you are crossing filesystem boundaries and firmlinks are in play as well as sym links. You can tell that with a df command and if it shows you have a Data APFS volume in addition to the system volume. Hopefully you don’t need to wait for terraform to fix deployment - it might be a simple error, but this is why we’re moving everything into /usr/local so that we get user and non-system installation off the read only disk of macOS sooner rather than later.

# diskutil list|grep Macintosh
   1:                APFS Volume Macintosh HD - Data     122.0 GB   disk1s1
   5:                APFS Volume Macintosh HD            11.2 GB    disk1s5