#1635 Issue closed: Timezone cannot be set due to missing file

Labels: fixed / solved / done, minor bug

gdha opened issue at 2017-12-08 09:38:

  • rear version (/usr/sbin/rear -V): rear-2.3 (freezed version)
  • OS version (cat /etc/rear/os.conf or lsb_release -a): centos 7
  • Brief description of the issue: timezone on recover vm is UTC instead of the expected CET
RESCUE client:~ # ls -l /etc/localtime
lrwxrwxrwx 1 root root 37 Dec  5 18:42 /etc/localtime -> ../usr/share/zoneinfo/Europe/Brussels
RESCUE client:~ # cat /etc/localtime
cat: /etc/localtime: No such file or directory
  • Work-around, if any: none

gdha commented at 2017-12-08 10:28:

Found the the problem with the tar command in build/GNU/Linux/100_copy_as_is.sh:

[gdha@antwerp rear]$ tar -P -C / -c -v -f /tmp/xxx /etc/localtime
/etc/localtime

[gdha@antwerp rear]$ tar -C /tmp -v -x -f /tmp/xxx
tar: Removing leading `/' from member names
/etc/localtime

[gdha@antwerp rear]$ ll /tmp/etc/localtime 
lrwxrwxrwx. 1 gdha gdha 37 Sep 11  2015 /tmp/etc/localtime -> ../usr/share/zoneinfo/Europe/Brussels

And, now add the option -h (dereference or follow the symbolic link):

[gdha@antwerp rear]$ tar -P -C / -c -v -h -f /tmp/xxx /etc/localtime
/etc/localtime

[gdha@antwerp rear]$ tar -C /tmp -v -x -f /tmp/xxx
tar: Removing leading `/' from member names
/etc/localtime

[gdha@antwerp rear]$ ll /tmp/etc/localtime 
-rw-r--r--. 1 gdha gdha 2944 Mar 27  2017 /tmp/etc/localtime

gdha commented at 2017-12-11 08:55:

Important note: the tar -h fix will not be implemented as it brings more issues then it fixes.

We will try to fix it via another way.

jsmeix commented at 2017-12-12 12:36:

@gdha
is this particular issue here fixed via
https://github.com/rear/rear/commit/7074bd5a56e201816fc30910c15a37a94abf2c00
so that this issue here can be closed for ReaR 2.3
and the remaining issue
https://github.com/gdha/rear-automated-testing/issues/47
would be solved separatedly?

gdha commented at 2017-12-12 14:33:

@jsmeix ntpdate sets the date correctly now, but due to the wrong locatime zone I'm still 1 hour off.
However, this is not a blocker for 2.3 as only the times in the logs are not in sync with the correct time. I can live with it for the moment. I'll move the target to 2.4 for this issue.

gdha commented at 2018-02-23 09:50:

PR https://github.com/rear/rear/pull/1734 fixed the issue


[Export of Github issue for rear/rear.]