systemd, timedatectl

Tom H tomh0665 at gmail.com
Thu Jul 30 11:17:24 UTC 2015


On Thu, Jul 30, 2015 at 3:38 AM,  <silver.bullet at zoho.com> wrote:
> On Thu, 30 Jul 2015 03:16:13 -0700, Tom H wrote:
>> On Wed, Jul 29, 2015 at 10:22 AM, <silver.bullet at zoho.com> wrote:


>>> a minimal Ubuntu Wily Werewolf (development branch) from the server
>>> ISO does cause a few issues. After using a clean systemd for around
>>> 2 or 3 years by an Arch Linux install, I now puzzle over Ubuntu's
>>> slightly inconsistent hybrid systemd.
>>>
>>> Is there any documentation about the mix of init.d scripts and
>>> systemd units?
>>>
>>> One thing that puzzles me is that timedatectl RTC in local TZ
>>> and /etc/default/rcS no UTC don't take effect.
>>
>> I don't see "/etc/default/rcS" being sourced by
>> systemd-timedated.service.
>>
>> So it'll work like a "non-hybrid" systemd system, via "timedatectl
>> set-local-rtc [0|1]", which will create/edit "/etc/adjtime".
>>
>> I don't know where there's specific init.d-in-systemd documentation on
>> the web but I'd start by looking at the systemd-sysv-generator and
>> systemd.generator man pages.
>
> Thank you,

You're welcome.


> this should solved the issue, since /mnt/moonstudio/ is the particular
> Ubuntu install.
>
> [rocketmouse at archlinux ~]$ cat /mnt/moonstudio/etc/adjtime
> 0.000000 1438115502 0.000000
> 1438115502
> UTC
> [rocketmouse at archlinux ~]$ cat /etc/adjtime
> -0.239597 1438163830 0.000000
> 1438163830
> LOCAL
>
> However, I'm not the only one experiencing this issue and since you ask
> what's different between Ubuntu and a distro using a clean systemd,
> take a look at my post here:
>
> https://lists.ubuntu.com/archives/ubuntu-studio-devel/2015-July/006559.html
>
> Ubuntu by default installs tons of irrelevant files and programs.

They're no irrelevant and they're present on any Linux system. At
least "/etc/localtime" is; when you change timezones via timedatectl,
"/etc/localtime" is updated - and it's the timezone setting on
non-systemd systems.

I don't know how Ubuntu uses "/etc/timeone" but I, for example, use it
when installing Gentoo or changing timezones on any distribution
because I run "ln -s /usr/share/zoneinfo/$(cat /etc/timezone)
/etc/localtime" (or "cp /usr/share/zoneinfo/$(cat /etc/timezone)
/etc/localtime" if "/usr" is its own partition and it's not being
mounted via an initramfs).

# timedatectl set-timezone America/New_York

# date
Thu Jul 30 06:49:51 EDT 2015

# timedatectl
      Local time: Thu 2015-07-30 06:50:18 EDT
  Universal time: Thu 2015-07-30 10:50:18 UTC
        RTC time: Thu 2015-07-30 06:50:18
       Time zone: America/New_York (EDT, -0400)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

# timedatectl set-local-rtc 1

# timedatectl
      Local time: Thu 2015-07-30 06:50:37 EDT
  Universal time: Thu 2015-07-30 10:50:37 UTC
        RTC time: Thu 2015-07-30 06:50:38
       Time zone: America/New_York (EDT, -0400)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.




More information about the ubuntu-users mailing list