sabayon, Tutorials/Tips

How to install and configure NTP on Sabayon 5

Sabayon 5Sabayon is a Gentoo-based, GNU/Linux distribution. The latest version, Sabayon 5, was released on October 2, 2009. The GNOME edition was just reviewed here. One thing I pointed out in that review is that the NTP (Network Time Protocol) package is not installed by default. This post provides a step by step guide on how to install and setup NTP on Sabayon 5.

NTP is the protocol that allows a networked device to sync it’s clock with that of NTP servers on the Internet. It allows your computer’s clock to be accurate, atomic-clock accurate.

Step one is to launch Sulfur, Sabayon’s graphical package manager, from the menu (System > Administration > Sulfur) or by double-clicking Sulfur’s icon on the desktop. Make sure that the “Available” tab is selected, and type in “ntp” into the search box. From the search results, right-click on the NTP package and select “Install”. Then click on the Installation tab to see the packages that are going to be installed.

Searching for the NTP package

The Installation tab shows that two packages will be installed. Click on the Commit Actions button to start installation.

When the installation is completed, you will find two scripts related to NTP under the /etc/init.d directory. These are the ntp-client and ntpd scripts. ntpd is used to maintain time on a running system. It is automatically started after installation. ntp-client is used to set time at boot. Unlike ntpd, you’ll have to manually start it. To do that, launch a shell terminal (Applications > Accessories > Terminal), su to root, and type /etc/init.d/ntp-client start as shown in the screenshot below.

Starting ntp-client

With that out of the way, now we are ready to set up the system to use NTP. Launch the Time and Date utility from the menu (System > Administration > Time and Date). Click on the Unlock button to gain the rights needed to change the system’s time.

Time and Date utility
Date and Time utility

With the Time and Date utility unlocked, you’ll notice that by default, the system sets its time manually. Click on the Configuration dropdown and select “Keep synchronized with Internet servers”. Make sure that your timezone is correctly selected.

mode selection

With NTP selected as the mode for setting time, the next screen presented allows you to select NTP servers to use. By default, four NTP servers are pre-selected, so you do not really need to do anything here.

NTP selected

The NTP servers pre-selected by the system. You may chose to de-select those and choose the NTP servers that you prefer to use.

Selecting NTP servers

That is all it takes to install and set up a Sabayon system to use NTP to set system clock.

Related Posts

Pentesting, digital forensics, and hacking distributions If you are interested in penetration testing (pentesting), digital forensics, and in playing with software applications that hackers use on a daily ba...
Why did this server run out of disk space? Less than two hours after I logged into the admin end of this website, which is powered by WordPress, the site went offline, with a 502 Bad Gateway er...
Linux and BSD desktop distributions with support for disk encryption Disk encryption is not something most personal computer users think of when they consider ways to boost the security profile of their computer. A fire...
How to install TwitteR, a Twitter client for R Installing packages in R is pretty easy, if you know the name of the package you wish to install. Just pass the name of the package to the install.pac...
How to dual-boot Linux Mint 10 and Windows 7 This is the latest in a series of tutorials that has been published on this site on how to dual-boot Windows 7 and Linux distributions. Previous artic...
Installation and disk partitioning guide for Ubuntu 13.10 This is a new user's guide for installing Ubuntu 13.10 on a computer that has another OS already installed on the hard disk drive (HDD). You would...

We Recommend These Vendors and Free Offers

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).

Deploy an SSD Cloud server in 55 seconds on DigitalOcean. Built for developers and starting at $5:00/month (20 GB SSD, 512 MB of RAM).

Want to become an expert ethical hacker and penetration tester? Request your free video training course of Online Penetration Testing and Ethical Hacking

Whether you're new to Linux or are a Linux guru, you can learn a lot more about the Linux kernel by requesting your free ebook of Linux Kernel In A Nutshell.


3 Comments

  1. In this tutorial you start the ntp-client manually by using the command:

    # /etc/init.d/ntp-client start

    However that command would not cause ntp-client to be started automatically when you reboot; it only starts ntp-client for the current session.

    Don’t you also have to add net-client to the default runlevel so that it starts automatically when you next boot?:

    # rc-update add ntp-client default

    Or does using ‘Kickoff > Computer > System Settings > Date & Time’ to configure KDE 4 to synchronise automatically with an NTP time server add ntp-client to the default runlevel for you?

    • Having now configured a couple of PCs to sync their system clock by using NTP, I can answer my own question regarding ntp-client:

      Although I have read on some sites that /etc/init.d/ntp-client should be added to the default runlevel in order to read the time from an NTP server (once-only, during start-up), this in fact does not work because usually the network connection is not up by the time the ntp-client initscript runs. Some solutions to this problem are given in the Sabayon Linux Forums thread http://forum.sabayon.org/viewtopic.php?f=59&t=15119

      If you are using NetworkManager on your PC, an elegant solution is to use NetworkManagerDispatcher to restart ntp-client in order to resync your system clock every time a network connection comes up. Another way is to create a cronjob to run the ntpdate command or the “/etc/init.d/ntp-client restart” command. Yet another way (a ‘quick-and-dirty’ solution) is to delay running ntp-client until the network is up after boot by putting e.g. “sleep 10s && /etc/init.d/ntp-client restart” in /etc/conf.d/local.

      Regarding the NTP daemon, it is possible to set this to run at start-up from the command line rather than via a Desktop Environment GUI. The command:

      # rc-update add ntpd default

      will add the daemon’s initscript to the default runlevel so that it is run automatically at next startup, and the command:

      # /etc/init.d/ntpd start

      will start the daemon running right now.

      If you make clock_systohc=”YES” in the file /etc/conf.d/hwclock then the time in the system clock will be written to the BIOS (CMOS) clock (a.k.a. hardware clock) when you shut down your PC. Sabayon Linux has the file configured this way by default.

      Note that, by default, the NTP daemon won’t correct, all in one go, a time difference between your system clock and the remote NTP server if that difference is above a certain size. However, if you want to override the default behaviour, i.e. allow the NTP daemon to make a large first adjustment to the system clock, you can set the environment variable NTPD_OPTS in the /etc/conf.d/ntpd file as follows:

      NTPD_OPTS=”-g”

      This would mean that you would not need to run ntp-client before ntpd. However, if you run ntp-client automatically — either once after start-up or periodically — then that would be good enough for the typical desktop user and could be an alternative to having a continuously-running NTP daemon. Nothing stops you doing both if you want, of course.

      • Thank you. For something this detailed, perhaps you should post it in the forum.

        Btw, running NTP is not as involved on a Debian-based system. It just works.

Leave a Comment

Your email address will not be published. Required fields are marked *

*