ltsp-build-client fails when /etc/localtime is a symlink to UTC
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LTSP5 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This was observed in Ubuntu 16.04.1 LTS:
When /etc/localtime is a symlink to UTC (the Ubuntu default), ltsp-build-client fails:
cp: '/etc/localtime' and '/opt/ltsp/
error: LTSP client installation ended abnormally
Looking at the files:
server2:~$ ls -l /etc/localtime /opt/ltsp/
lrwxrwxrwx 1 root root 27 Jan 23 23:23 /etc/localtime -> /usr/share/
lrwxrwxrwx 1 root root 27 Jan 30 15:23 /opt/ltsp/
This is coming from 035-copy-timezone:
if [ -f /etc/timezone ]; then
cp /etc/timezone $ROOT/etc/timezone
cp /etc/localtime $ROOT/etc/localtime
fi
And in the case when /etc/localtime is a different symlink (that is, not to the Ubuntu default of UTC and the 'cp' doesn't fail), the above code messes up the *actual* UTC/GMT/Zulu timezone files (which are all symlinked to each other) in /usr/share/zoneinfo by copying the system timezone to it:
server1:~$ ls -lL /usr/share/
-rw-r--r-- 1 root root 3545 Oct 21 07:42 /usr/share/
-rw-r--r-- 1 root root 3545 Oct 21 07:42 /usr/share/
Also related to the above bug is this code for LTSP clients (pkg ltsp-client-core) which also blindly copies to /etc/localtime:
/usr/share/ ltsp/init- ltsp.d/ 50-set- time
if [ -n "$TIMEZONE" ] && [ -e "/usr/share/ zoneinfo/ $TIMEZONE" ]; then zoneinfo/ $TIMEZONE /etc/localtime 2>/dev/null
cp /usr/share/
fi
I think both the LTSP build and client code should be changed to create a symlink (after first checking it isn't already a symlink pointing to the correct file).