New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[timed] Change location of time zone link that timed manages #23
Conversation
| @@ -346,7 +348,7 @@ int source_settings::check_target(string path) | |||
| return -1 ; | |||
| // The file exists and is a regular file ! | |||
| ino_t inode = s.st_ino ; | |||
| res = stat("/etc/localtime", &s) ; | |||
| res = stat("LOCALTIMELINK", &s) ; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be quoted, should it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, will remove quotes.
|
Updated pull request:
|
|
LGTM |
| tzset() ; | ||
| if(unlink_res) | ||
| { | ||
| log_error("can't unlink /etc/localtime: %m") ; | ||
| log_error("can't unlink LOCALTIMELINK: %m") ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we want to log the path, not the macro name?
"can't unlink "LOCALTIMELINK": %m"
or
"can't unlink %s: %m", LOCALTIMELINK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, will fix.
|
Updated pull request:
|
|
|
||
| %pre | ||
| groupadd -rf timed | ||
| groupadd-user timed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these you need also to have Requires: lines set properly for oneshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, added %{_oneshot_groupadd_requires_pre}, %{_oneshot_groupadd_requires_post}, other oneshot requires are already present.
Timed links time zone files in /usr/share/zoneinfo to /var/lib/timed, for example /var/lib/timed/localtime -> /usr/share/zoneinfo/Europe/Helsinki The system time zone /etc/localtime is in turn linked to /var/lib/timed/localtime, so that it follows the time zone set by timed. The directory /var/lib/timed can be modified by root and members of group timed, timed installation creates group timed and adds the default user to the group. These changes are required as timed is not run with root privileges, and it does not have the rights to change /etc/localtime.
|
OK |
[timed] Change location of time zone link that timed manages
Timed links time zone files in /usr/share/zoneinfo to
/var/lib/timed, for example
/var/lib/timed/localtime -> /usr/share/zoneinfo/Europe/Helsinki
The system time zone /etc/localtime is in turn linked to
/var/lib/timed/localtime, so that it follows the time zone
set by timed.
These changes are required as timed is not run with root
priviledges, and it does not have the rights to change
/etc/localtime.