Author Topic: How to run ntpd automatically  (Read 3597 times)

daftslacker

  • Member
  • *
  • Posts: 8
How to run ntpd automatically
« on: August 22, 2014, 07:24:17 pm »
I want ntpd to be started when the computer boots, but I don't know how. I want the time to always be correct on the computer. I found a possible solution in http://forum.vectorlinux.com/index.php?topic=16494.0 but I couldn't find a ntpd script file on the page referred to in the post: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/ntpd?h=packages/ntp. I've already set up the ntp.conf file. If it's something that can be managed with vasm, then I wonder why VL doesn't install a script in /etc/rc.d/init.d or put one in /etc/rc.d/init.d/sample. The file /etc/rc.d/rc.ntpd exists, but I don't know what that does because ntpd is not running when the system is up. I have been able to run it manually though. I'm using VL 7 standard.

bigpaws

  • Administrator
  • Vectorian
  • *****
  • Posts: 1906
Re: How to run ntpd automatically
« Reply #1 on: August 22, 2014, 08:28:29 pm »
Open a terminal.

The su to root and type: ls -la /etc/rc.d/rc.ntpd

The output will look like this:
-rw-r--r-- 1 root root 804 Jul  4  2012 /etc/rc.d/rc.ntpd

If the output looks like that you need to make it executable.

Now type:
chmod +x /etc/rc.d/rc.ntpd

Then check with the first command.

It should look like this:
-rwxr-xr-x  1 root root 804 Jul  4  2012 /etc/rc.d/rc.ntpd

If you want the service to start without needing to restart type:
/etc/rc.d/rc,ntpd

That will start that service.

Now when you restart the system i will start automatically.

Please note that there is a way using a GUI to do this. My method
imo is easier.

HTH

Bigpaws




roarde

  • Vectorian
  • ****
  • Posts: 791
  • it's enough
Re: How to run ntpd automatically
« Reply #2 on: August 22, 2014, 10:30:35 pm »
If that doesn't work for you,
Code: [Select]
cp /etc/rc.d/rc.ntpd /etc/rc.d/init.d/ntpdand manage it with vasm>service>srvset.

And you're right. It's either an error in the ntp package or in the init scripts. Nice find :)

Note: This is for VL 7.0. 7.1's ntp package has errors presently, and vasm-legacy can't handle what's changed in services yet.
« Last Edit: August 22, 2014, 10:35:10 pm by roarde »
Robert

daftslacker

  • Member
  • *
  • Posts: 8
Re: How to run ntpd automatically
« Reply #3 on: September 01, 2014, 11:34:19 am »
The rc.ntpd script was already set as executable, but it still wasn't automatically running. Once I copied to to init.d and set it in vasm, it was running. Thanks.

roarde

  • Vectorian
  • ****
  • Posts: 791
  • it's enough
Re: How to run ntpd automatically
« Reply #4 on: September 01, 2014, 04:51:42 pm »
and thanks for the feedback, daftslacker.

I say there should be a decision whether to mention this (or sntp) in rc.M, or to edit its script to apply to init.d/ and move it there.
Robert