if (lstat(path_localtime, &sb) < 0) {
/* Nothing there yet... */
copymode = 1;
} else if (S_ISLNK(sb.st_mode))
copymode = 0;
else
copymode = 1;
if [ -L "$_PATH_LOCALTIME" ]; then
copymode=
elif [ ! -e "$_PATH_LOCALTIME" ]; then
# Nothing there yet...
copymode=1
else
copymode=1
fi
So there's this weird code in install_zoneinfo_file():
Code:if (lstat(path_localtime, &sb) < 0) { /* Nothing there yet... */ copymode = 1; } else if (S_ISLNK(sb.st_mode)) copymode = 0; else copymode = 1;
As I read it, "if /etc/localtime exists and it's symlink, use symlink", and it dates back to ancient times with no explanation what could install the symlink originally.
Same weird logic is in bsdconfig (/usr/src/usr.sbin/bsdconfig/timezone/share/zones.subr):
Code:if [ -L "$_PATH_LOCALTIME" ]; then copymode= elif [ ! -e "$_PATH_LOCALTIME" ]; then # Nothing there yet... copymode=1 else copymode=1 fi
This still does not provide any hints why there would be a symlink originally.
The other odd thing is that the existing symlink isn't checked to point anywhere sensible, it's just replaced.
I still have my old, 13.1 boot environment, so at least I can confirm it was a symlink before the upgrade:None of which helps zirias@ unless he has older backups of /etc?
nexus# bectl mount 13.1 /mnt/tmpdev
Successfully mounted 13.1 at /mnt/tmpdev
nexus# ls -l /mnt/tmpdev/etc/localtime
lrwxr-xr-x 1 root wheel 33 19 Feb. 10:14 /mnt/tmpdev/etc/localtime -> /usr/share/zoneinfo/Europe/Berlin
tzsetup
to fix the problem, it must still have been a symlink. To me, it remains a bit mysterious.etcupdate
?