You are not logged in.

#1 2013-01-13 14:35:59

wardenclyffe
Member
Registered: 2013-01-13
Posts: 5

[SOLVED] Cannot set timezone with timedatectl

Hi all, I've searched around the forums and relevant wiki pages and cannot work out what the issue is.

I'm having trouble setting the local timezone. This is a completely fresh install and I've updated all packages. There are no other OSes and hwclock is set as UTC as recommended.

When I run (as user with sudo or as root)

timedatectl set-timezone Australia/Melbourne

it returns

Failed to issue method call: Is a directory

However the change is reflected in timedatectl status, which outputs

Local time: Sun, 2013-01-13 14:21:49 UTC
Universal time: Sun, 2013-01-13 14:21:49 UTC
RTC time: Sun, 2013-01-13 14:21:50
Timezone: Australia/Melbourne
UTC offset: +0000
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a

But no symlink is created in /etc/localtime, and no UTC offset is displayed and on reboot the settings reset and timedatectl shows no timezone specified again; and my local time remains UTC.

I've tried using other zones with the same result.

I have also tried manually setting setting the link e.g.

ln -s /usr/share/zoneinfo/Australia/Melbourne /etc/localtime

The symlink is definitely present and correct but timedatectl does not show up as having a timezone selected despite the presence of the symlink.

Some other potentially relevant info:

cat /etc/adjtime
0.077769 1358085477 0.000000
1358085477
UTC
hwclock --debug
hwclock from util-linux 2.22.2
Using /dev interface to clock.
Last drift adjustment done at 1358085477 seconds after 1969
Last calibration done at 1358085477 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/01/13 14:31:40
Hw clock time : 2013/01/13 14:31:40 = 1358087500 seconds since 1969
Sun 13 Jan 2013 14:31:40 UTC  -0.375831 seconds

I also attempted to set the timezone and hwclock to UTC in /etc/rc.conf to no avail.

Thanks very much for reading. I'm sure the answer is simple but I've spent several hours looking and I just can't think of anything else to try.

Last edited by wardenclyffe (2013-01-14 09:57:28)

Offline

#2 2013-01-13 16:36:10

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Cannot set timezone with timedatectl

The change isn't really reflected in the status of timedatectl. It should list something different for local time. Maybe also the utc offset though I'm not sure. (Mine also shows zero but I think it should not be for Melbourne.)

Are you trying to use hwclock and ntp? I thought that wouldn't work... I ask because you have ntp "enabled" but not "synchronized" but are then running hwclock.

EDIT: Are you not yet using systemd to boot? If not, you should consider switching. If you are, rc.conf is deprecated.

Last edited by cfr (2013-01-13 16:42:56)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-01-14 03:10:55

wardenclyffe
Member
Registered: 2013-01-13
Posts: 5

Re: [SOLVED] Cannot set timezone with timedatectl

Thanks for the reply,

Melbourne should be +1100 at the moment.

I have tried this with NTPd enable, disabled, installed, uninstalled. All that's doing is correcting UTC, it doesn't seem to make any difference to the local time regardless of what I do with it (beyond just syncing it to UTC).

And the hwclock --debug, I only posted as I've seen a lot of other posts where that has been asked for for diagnostic purposes. I don't have it set up as a cron job or anything, beyond what arch does by default.

Thanks again.

Offline

#4 2013-01-14 03:44:53

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Cannot set timezone with timedatectl

Hmm... Maybe I'm wrong then. I had thought that the fact that you had the adjtime file meant you must be using hwclock.

For example, I use ntp and I find:

/var/lib/ntp/ntp.drift

but I don't have the adjtime file at all.

Can you check that ntp is running and that hwclock is not? (Or the other way around - whichever you want.)

Last edited by cfr (2013-01-14 03:45:17)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-01-14 07:30:36

wardenclyffe
Member
Registered: 2013-01-13
Posts: 5

Re: [SOLVED] Cannot set timezone with timedatectl

Thanks again for your help,

I've double checked hwclock and can't find any evidence that it is running.

NTPd is; systemctl status ntpd gives

	  Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
	  Active: active (running) since Mon, 2013-01-14 03:57:51 UTC; 3h 31min ago
	 Process: 252 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=0/SUCCESS)
	Main PID: 292 (ntpd)
	  CGroup: name=systemd:/system/ntpd.service
		  └─292 /usr/bin/ntpd -g -u ntp:ntp

My /var/lib/ntp/ntp.drift contains

-0.257

EDIT:

I found a suggestion on the raspberrypi forums to explicitly disable hwclock daemon via /etc/rc.conf e.g. DAEMONS=(!hwclock) but that didn't change anything.

On boot I still get the following from timedatectl and still cannot set timezone.

      Local time: Mon, 2013-01-14 07:38:03 UTC
  Universal time: Mon, 2013-01-14 07:38:03 UTC
        RTC time: Mon, 2013-01-14 07:38:03
        Timezone: n/a
      UTC offset: +0000
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

Last edited by wardenclyffe (2013-01-14 07:43:35)

Offline

#6 2013-01-14 08:05:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Cannot set timezone with timedatectl

You keep mentioning rc.d and rc.conf. STOP! They simply don't exist on a new Arch installation. Any reference you read that includes those, just ignore them.

First thing, try reinstalling the zoneinfo package. Had a situation like this a while ago that ended up being fixed that way. Reinstall the package and make the symlink and see if anything changes.

Offline

#7 2013-01-14 08:53:32

wardenclyffe
Member
Registered: 2013-01-13
Posts: 5

Re: [SOLVED] Cannot set timezone with timedatectl

Thanks Scimmia, I figured an explanation for this might be a conflict between the old and the new system but it looks like that might not be the case.

I uninstalled tzdata and reinstalled, and made a symlink manually.

The symlink persists through a reboot, but my UTC offset remains 0000 and timezone reads n/a. Attemping to do timedatectl set-timezone Australia/Melbourne returns the same error message the first time it is run, but running it subsequent times returns no error message - it still wont create the symlink itself though, all it does it makes timedatectl read out Timezone: as whatever you enter but does not set UTC offset.

ls -l /etc/localtime
total 0
lrwxrwxrwx 1 root root 39 Jan 14 08:43 Melbourne -> /usr/share/zoneinfo/Australia/Melbourne

Here is what timedatectl returns immediately after booting into X/openbox

      Local time: Mon, 2013-01-14 08:45:08 UTC
  Universal time: Mon, 2013-01-14 08:45:08 UTC
        RTC time: Mon, 2013-01-14 08:45:08
        Timezone: n/a
      UTC offset: +0000
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

Thanks again!

Last edited by wardenclyffe (2013-01-14 08:56:31)

Offline

#8 2013-01-14 09:00:01

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,682

Re: [SOLVED] Cannot set timezone with timedatectl

Hmmmm
On my machine, /etc/localtime is a file, not a direcory

$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 38 Mar 31  2012 /etc/localtime -> /usr/share/zoneinfo/Australia/Brisbane

which explains the error message in your first post

Last edited by skunktrader (2013-01-14 09:02:44)

Offline

#9 2013-01-14 09:57:02

wardenclyffe
Member
Registered: 2013-01-13
Posts: 5

Re: [SOLVED] Cannot set timezone with timedatectl

Skunktrader ... I have no words, that was the issue.

Thanks so much... I can't believe I didn't think of this, it's so obvious in hindsight.

Thanks all for your help!

Offline

Board footer

Powered by FluxBB