Bug #3437
closed"Global time settings: Time zone" error
Description
The following error appears in the web interface:
- Rule: Global time settings - Directive: Global time settings - Component: Time zone - Value: None - Message: Time zone could not be set (localtime file could not be changed) - Status: Error
Removing /etc/localtime makes the following error dissappear:
R: @@ntpConfiguration@@result_error@@87cd8f51-de03-43e4-88ea-bb4d55c27878@@342fc6d5-9399-4a93-87e0-9c7efd2d9727@@19@@Time zone@@None@@2013-04-1213:05:34+02:00##root@#Time zone could not be set (localtime file could not be changed)
After running cf-agent -KI a symlink is created:
lrwxrwxrwx 1 root root 25 Apr 12 11:07 /etc/localtime -> ../posix/Europe/Amsterdam
Running cf-agent -KI now produces the following output:
-> Link /etc/localtime as promised R: @@ntpConfiguration@@log_info@@87cd8f51-de03-43e4-88ea-bb4d55c27878@@342fc6d5-9399-4a93-87e0-9c7efd2d9727@@19@@Time zone@@None@@2013-04-12 11:07:46+00:00##root@#Time zone was already set (localtime file didn't need changing)
The problem is in /var/rudder/cfengine-community/inputs/clockConfiguration/1.0/clockConfiguration.cf - the file to copy to /etc/localtime is a relative symlink:
lrwxrwxrwx 1 root root 25 Sep 15 2012 /usr/share/zoneinfo/Europe/Amsterdam -> ../posix/Europe/Amsterdam
I think the solution would be that, if the file to copy is a symlink, to first follow the symlink and then copy that file.
With the following patch it seems to be fixed:
--- /var/rudder/cfengine-community/inputs/common/1.0/rudder_lib.cf 2013-04-12 14:48:07.208471906 +0200 +++ /var/rudder/cfengine-community/inputs/common/1.0/rudder_lib.cf.orig 2013-04-12 14:47:51.280471263 +0200 @@ -278,9 +278,8 @@ ######################################### body copy_from digest_cp(from) { -source => "$(from)"; -compare => "digest"; -copylink_patterns => { ".*" }; +source => "$(from)"; +compare => "digest"; } ################################################
Updated by Dennis Cabooter over 11 years ago
The patch should (of course) be the other way round:
--- /var/rudder/cfengine-community/inputs/common/1.0/rudder_lib.cf.orig 2013-04-12 14:47:51.280471263 +0200 +++ /var/rudder/cfengine-community/inputs/common/1.0/rudder_lib.cf 2013-04-12 14:48:07.208471906 +0200 @@ -278,8 +278,9 @@ ######################################### body copy_from digest_cp(from) { -source => "$(from)"; -compare => "digest"; +source => "$(from)"; +compare => "digest"; +copylink_patterns => { ".*" }; } ################################################
Updated by Matthieu CERDA over 11 years ago
- Category set to Techniques
- Status changed from New to In progress
- Assignee set to Matthieu CERDA
- Priority changed from N/A to 3
- Target version changed from 2.5.2 to 2.3.12
Agreed. Modifying.
Updated by Matthieu CERDA over 11 years ago
- Status changed from In progress to Pending technical review
- % Done changed from 0 to 100
- Pull Request set to https://github.com/Normation/rudder-techniques/pull/76
PR to be done.
Updated by Nicolas CHARLES over 11 years ago
- Status changed from Pending technical review to Pending release
thank you Matthieu and Dennis !
The fix has been merged
Updated by Nicolas CHARLES over 11 years ago
This has been merged into 2.3 but unfortunately the merge to the 2.4 branch lost the commit in the renaming :(
Updated by Nicolas CHARLES over 11 years ago
The merge has been corrected on the 22/04/2013
Updated by Nicolas CHARLES over 11 years ago
Applied in changeset policy-templates:commit:f7dffdbc16834f23992b4739a4d932b84063eae2.
Updated by Nicolas PERRON over 11 years ago
- Status changed from Pending release to Released