Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8285645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:31:21+00:00 2026-06-08T11:31:21+00:00

I’m using a BeagleBone, and since it has no built in RTC and battery

  • 0

I’m using a BeagleBone, and since it has no built in RTC and battery back up, it loses the date on every reboot. I can easily set the date with the command:

/usr/bin/ntpdate -b -s -u pool.ntp.org

But if the power goes out and back on for the house for example, then the time is lost. The solution that comes with the latest beaglebone Angstrom linux distribution is to put a crontab line in that updates the time every half hour. But I would prefer to just run the command once on powerup.

I tried putting this command listed above in crontab with the @reboot line, but that I believe ran before network was configured, or something else failed since it didn’t get me the right time when I pulled the power for 5 minutes and put it back to the beaglebone.

Is there some way to use ifconfig or something like that to run a script from init.d only after network is available?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:31:22+00:00Added an answer on June 8, 2026 at 11:31 am
    opkg install ntp-systemd
    systemctl enable ntpdate.service
    systemctl enable ntpd.service
    

    Edit /etc/ntp.conf and comment the following lines (no fallback on an hardware clock that doesn’t exist and because the ntpdate service use the “ntpd -q” command)

    #server 127.127.1.0
    #fudge 127.127.1.0 stratum 14
    

    Two services are installed:

    /lib/systemd/system/ntpd.service:

    [Unit]
    Description=Network Time Service
    After=network.target
    
    [Service]
    Type=forking
    PIDFile=/run/ntpd.pid
    ExecStart=/usr/bin/ntpd -p /run/ntpd.pid
    

    /lib/systemd/system/ntpdate.service:

    [Unit]
    Description=Network Time Service (one-shot ntpdate mode)
    Before=ntpd.service
    
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/ntpd -q -g -x
    RemainAfterExit=yes
    

    ntpd is started after the network is up (After=network.target) so the date should be continuously synchronized. BUT has explained in the ntpd man page:

    Most operating systems and hardware of today incorporate a
    time-of-year (TOY) chip to maintain the time during periods when the
    power is off. When the machine is booted, the chip is used to
    initialize the operating system time. After the machine has
    synchronized to a NTP server, the operating system corrects the chip
    from time to time. In case there is no TOY chip or for some reason its
    time is more than 1000s from the server time, ntpd assumes something
    must be terribly wrong and the only reliable action is for the
    operator to intervene and set the clock by hand. This causes ntpd to
    exit with a panic message to the system log. The -g option overrides
    this check and the clock will be set to the server time regardless of
    the chip time. However, and to protect against broken hardware, such
    as when the CMOS battery fails or the clock counter becomes defective,
    once the clock has been set, an error greater than 1000s will cause
    ntpd to exit anyway.

    So we need to set the date before starting ntpd and this is done by the ntpdate service by executing “ntpd -q -g -x” before starting ntpd.service.

    From ntpd man page:

    -q Exit the ntpd just after the first time the clock is set. This behavior mimics that of the ntpdate program, which is to be retired.
    The -g and -x options can be used with this option. Note: The kernel
    time discipline is disabled with this option.


    Another service installed on the Beaglebone interact with the date/time

    timestamp.service

    [Unit]
    Description=Timestamping service
    ConditionPathExists=/etc/timestamp
    After=remount-rootfs.service
    
    [Service]
    RemainAfterExit=yes
    ExecStart=/usr/bin/load-timestamp.sh
    ExecStop=/usr/bin/load-timestamp.sh --save
    

    This service store the current timestamp in /etc/timestamp when it’s stopped and set the date from that timestamp when it’s started. So if ntpd isn’t installed, the date set manually and the beaglebone rebooted, the date is only behind by the boot duration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.