16 Replies Latest reply on Jun 4, 2019 11:46 AM by colporteur

    Establishing time in Raspbian Stretch Release 2019-04-08

    colporteur

      G'Day,

      Does someone have the inside track on how time is established with the current version of Raspbian?

       

      I'm looking for the details starting from power-up to power down. If you have some insight into fake-hwclock that would be useful also.

       

      The references I have found refer to ntp as the seed source for time. I can find no ntp services or configuration files in the current release. I'm stumped on finding time. Unfortunately, I am away from my network currently and can't do more extensive testing. I was hoping someone had insight or a link I could do some reading.

       

      Sean

        • Re: Establishing time in Raspbian Stretch Release 2019-04-08
          dougw

          Is your concern that your Pi is not set to the correct time, or do you want to improve on the time accuracy it keeps?

          If your Pi is connected to the Internet, on power up it will use Network Time Protocol to get the correct time.

          The Pi needs to be configured for your time zone in raspi-config under Localization Options.

          If you are not connected to the Internet, you may need to add an external RTC.

          1 of 1 people found this helpful
            • Re: Establishing time in Raspbian Stretch Release 2019-04-08
              colporteur

              G'Day,

              Time is functioning as expected. I am trying to understand how. If ntp is used as you suggest, when and how?

               

              I am currently experimenting with a technology call zymbit. In their write-up they suggest ntp time source is used on Pi's. They override it with the RTC. At one point ntp was used but on the current Raspbian version I can find no indication. i.e. no ntp.conf no ntp.services.

               

              All references on the internet associated with time predate the current release. I don't have my network tools to watch the output of a Pi booting. So i can't get answers.

               

              Sean

                • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                  gdstew

                  I believe the latest Raspbian releases use systemd and it has its own lightweight ntp client, systemd-timesync. There should be a /etc/systemd/timesyncd.conf file and the timedatectl status command

                  should produce useful information about the ntp server and time. You can google for more information about this service and command. I'm sure the time for fake-hwclock is initialized at boot and it may also be updated

                  at regular intervals while Raspbian is running.

                  3 of 3 people found this helpful
                    • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                      colporteur

                      Thank you for the response. I will follow up on these bread crumbs to further my discovery.

                       

                      I suspected time sync relied on some form of ntp. At one point ntp daemon could be found and configured. Not finding the service listed lead me to believe some changes had been made. Suggesting Pi uses ntp for time sync is correct but details I found seem to refer to the old method and not what is currently used.

                       

                      Sean

                        • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                          Roger Wolff

                          Even if the raspberry would use NTP to get the time that would not automatically imply that the NTP package needs to be installed. Especially when you don't need a super precise time estimate, a primitive NTP client could be something like 20 lines-of-code. So after deciding: "we're going to do NTP for the time", it can be either: "lets use ntpdate, then we don't have to write any code", or "lets just write our own client, it's less than 20 lines..." Both decisions have their merit.

                            • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                              colporteur

                              My frustration is how the meaning of terms like ntp are watered down.

                               

                              I acknowledge the application of ntp is diverse. Why use CPU cycles to run a daemon when a kick in the pants to adjust time every few minutes is acceptable. As an individual that was once responsible for supporting time in a telecommunication environment the term ntp has a comprehensive meaning.

                               

                              How ntp is applied in Raspberry Pi appears to have changed. When google searches return ntp results from a year ago that suggest ntp.conf, it has the potential to confuse the Raspberry Pi'er using todays O/S. 

                               

                              Sean

                                • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                  gdstew

                                  I share your frustration. The reason my response was so sparse on information was that I don't care for systemd at all. On of the biggest reasons is that it has

                                  a really bad case of feature creep so much so that what was originally touted as a new and improved init system now has 1.2 million lines of code. A little over

                                  a year ago I swapped distributions for my home computers from Debian which uses systemd to Devuan which doesn't but I still can't just ignore it. So anytime

                                  somebody says they can't find some program or configuration file that should (must?) exist the first thing I google for is a systemd version and this is how I

                                  found systemd-timesync.

                                  2 of 2 people found this helpful
                                    • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                      colporteur

                                      Thanks for your insight. I grew up with writing machine language code to maximize memory. Efficient coding no longer appears to be a concern.

                                      Sean

                                      • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                        jomoenginer

                                        This is not a Raspbian thing but a Debian Stretch thing considering Raspbian is pulled from the Debian source.  Stretch does not use ntp but rather systemd-timesyncd.

                                         

                                        https://manpages.debian.org/stretch/systemd/systemd-timesyncd.service.8.en.html

                                        https://manpages.debian.org/stretch/systemd/timesyncd.conf.5.en.html

                                         

                                        However, to understand what is new in Raspbian you can look through the Readme for the release:

                                        http://downloads.raspberrypi.org/raspbian/release_notes.txt

                                         

                                        Or Debian Release notes:

                                        https://www.debian.org/releases/stable/armhf/release-notes/

                                         

                                        Welcome to Linux.

                                        3 of 3 people found this helpful
                                          • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                            gdstew

                                            Yes it is a Raspbian thing, Devuan is Debian stretch without systemd and there are seven other main Linux distributions that do not use systemd (source

                                            wikipedia). However, given the long time use of the Debian code base, the effort required to get stretch to work without systemd (it took the Devuan people

                                            almost a year to get to a fully working 1.0), and the user space environment that has grown up around it, I can understand why it would not be the preferred

                                            path for Raspbian. Devuan also has a Raspberry Pi version that I installed and did some preliminary testing with almost a year ago and although it worked

                                            OK it was not up to par with Raspbian in a few areas. What I would really like to see is a full fork of Raspbian to Devuan but due to the effort required and

                                            the resources available to the Devuan people I don't think this will happen any time soon.

                                             

                                            Sean,

                                             

                                            I am a long time assembly language guy mainly writing code for microcontrollers (mostly 8051 derivatives) for PBX phones and other telecom equipment

                                            so I know exactly where you are coming from. I've also used C extensively for writing drivers for boards I've designed and other support/test programs.

                                            You may want to look into the Raspberry Pi version of Devuan if you would prefer a more "traditional" version of Linux.

                                            1 of 1 people found this helpful
                                              • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                                jomoenginer

                                                Debian is the main distro; all derivatives of it are just fork distros.

                                                 

                                                Devuan sounds like it was created by folks that don't want to move forward with the rest of the Linux world.  Fedora runs into this as well where Red Hat 7 / CentOS 7 implement enough changes from 6.x that it causes havoc for some folks.   I had seen the same issue when Solaris went from 9 to 10.  OS evolution is fun.

                                                 

                                                I suppose you could always fork Debian and create you own distro configured the way you want it.

                                                 

                                                Or just stop systemd-timesyncd from running.

                                                https://stackoverflow.com/questions/43093636/stop-timesyncd-from-polling-hard-coded-debian-timeservers

                                                  • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                                    colporteur

                                                    I was a faithful Fedora patron for many years. Their move to Wayland Display gave me cause to move to Ubuntu. CentOS was the primary work O/S because the company deployed RedHat in production.

                                                     

                                                    I dabbled in BSD for a firewall build before router price points didn't make sense to invest the effort to maintain your own when you could purchase a unit at a lower cost.

                                                     

                                                    I need the dependability of mainstream linux. Ubuntu on my desktop and Mint 18 on a MacBook Pro. The Mac O/S confuses the heck out of Apple users:)

                                                     

                                                    Sean

                                                    • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                                      gdstew

                                                      "Debian is the main distro; all derivatives of it are just fork distros."

                                                       

                                                      Not all forks are created equal. Unbuntu is an excellent example as they have made extensive changes to the Debian code base. And took a lot of work to

                                                      de-systemd the code for Devuan. Debian was supposed to be able to install a non-systemd version of stretch. I tried it and it didn't work. It was the first time

                                                      I couldn't get an installed Debian to work since I began using it with sarge.

                                                       

                                                       

                                                      "Devuan sounds like it was created by folks that don't want to move forward with the rest of the Linux world."

                                                       

                                                      Perhaps you missed the part where I mentioned that seven other main Linux distros including Slackware do not use systemd (there are twelve that do). There are

                                                      several good reasons why people don't like systemd and feature creep and its side effects is a big one. The fact that the creeping feature's interfaces are not

                                                      compatible with older software that uses them is another (logging, ntp, dns, dhcp, terminal driver, just to name a few of those 1.2 million lines). The fact that all

                                                      new, incompatible and newly buggy versions of these creeping features are not really needed and don't really add anything to the existing versions (see previous

                                                      list, with the possible exception of logging) is yet another. The growing interdependancies of systemd features, highlighted by the difficulty of removing it and the

                                                      fact that a systemd stub library has to be used to get some things to work also cause concern. There are more.

                                                       

                                                       

                                                      "OS evolution is fun."

                                                       

                                                      Not when it causes problems in the real world. One of the main attractions of Debian was that they valued stability over shiny for their releases. Well they used

                                                      to at least.

                                                       

                                                       

                                                      "I suppose you could always fork Debian and create you own distro configured the way you want it."

                                                       

                                                      Don't have to. Debian was a very good distro until systemd. Devuan fixed that problem.

                                                       

                                                       

                                                      Anyway argue about it all you like I am done here. Like I said, I don't like it but I can't ignore it. At least for most of my work I don't have to use it. Thanks Devuan.

                                                        • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                                          jomoenginer

                                                          So, if I do not agree with you its an argument?  So be it.

                                                           

                                                          Slackware? Really?  "Now, that's a name I've not heard in a long time. A long time." Like the mid '90s or so.

                                                           

                                                          Sorry, outside of my own work with numerous Linux distros with multiple install variations (currently: Ubuntu, Armbian, Raspian, Mint, CentOS, SuSe and so on), my work with Linux stems from the Professional Enterprise Storage realm and Linux driver development; mainly with mass storage and its associate connectivity as well as DevOps config.  I'm quite aware of the issues that are seen with changes in OS versions; especially with the Enterprise ones such as Red Hat, SuSe, BSD and such . I guess my view of Linux is a bit skewed.

                                                           

                                                          My "OS evolution is fun" comment was a bit of sarcasm.

                                                           

                                                          Good luck.

                                                            • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                                              colporteur

                                                              I chuckle at the commentary.

                                                               

                                                              O/S's affiliation is like the beliefs of Judeo-Christian religions. I believe in this, your belief is wrong in order for my belief to be right. You're belief is surely delivering you to hell.

                                                               

                                                              Slakeware I dabbled in during the early 90's. I was impressed with the dedication and focus of the maintainer. No doubt still the same guy. His casket will be lined with the original 5.25 floppy disks of the O/S  when he goes to meet his maker.

                                                               

                                                              Sean

                                                        • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                                          colporteur

                                                          I worked in PBX for a very short time supporting an operational support system that gathered PBX data. Dedicated dialup lines connected the server to each PBX. The company sold the data analysis on the PBX traffic data. Banks used the reports to staff help lines.

                                                           

                                                          Ironically the system was using Solaris 5. One of my first system administration tasks was to upgrade the system to Solaris 6. Little documentation and no SME made it a nail biter upgrade. Screwed the root password and locked myself out. Ouch!

                                                           

                                                          Sean

                                                        • Re: Establishing time in Raspbian Stretch Release 2019-04-08
                                                          colporteur

                                                          Thanks for the links, I look forward to the read. I'm interest in the documentation on development of the application. My search criteria didn't return much in the way of results.

                                                           

                                                          Sean