LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-17-2006, 12:36 PM   #16
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36

This got me motivated to update my own rc.ntp script - could someone please advise how to make a shell-script read the /etc/ntp.conf and grab the preferred server based on the "prefer" statement in the config file:
Code:
server 0.no.pool.ntp.org prefer
server 1.europe.pool.ntp.org
server 2.europe.pool.ntp.org
Ie. scan the prefer keyword on a line beginning with server and thus extract 0.no.pool.ntp.org from this line, and use that server for the initial ntpdate command in the beginning of the rc.ntp script ?

-Y1
 
Old 09-17-2006, 03:30 PM   #17
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
I have posted my mini how-to about configuring the NTP software with Slackware:

Configuring the NTP Daemon

Scripts and config files are included.

All comments and corrections are appreciated.
 
Old 10-08-2006, 08:41 AM   #18
ralvy
Member
 
Registered: Nov 2004
Posts: 36

Rep: Reputation: 15
Quote:
Originally Posted by Woodsman
I have posted my mini how-to about configuring the NTP software with Slackware:

Configuring the NTP Daemon

Scripts and config files are included.

All comments and corrections are appreciated.
Thanks for your thorough article on Slackware and ntp. Concerning this part of the article

Quote:
Some caveats. The Slackware /etc/rc.d/rc.inet1 initializes the dhcpc daemon such that dhcpcd will overwrite /etc/ntp.conf. Avoid that problem by adding an -N switch to all of the /etc/rc.d/rc.inet1 lines starting the dhcpc daemon. Or, rather then modify the rc.d scripts, edit etc/rc.d/rc.inet1.conf for the affected network card by adding DHCP_KEEPNTP[x]="yes". People using static IP addresses need not worry about this caveat.
I have opted instead to not touch rc.d scripts to handle this, other than rc.local. That way, if any of the other rc scripts change, I don't need to worry about editing them again. First, I save a copy of my edited /etc/ntp.conf file to /etc/ntp.conf.good. Then I put this in /etc/rc.d/rc.local:

Code:
ntpdate 0.us.pool.ntp.org 1.us.pool.ntp.org
ntpd -c /etc/ntp.conf.good
That way, if another rc.d script stomps on /etc/ntp.conf, I don't have to worry about it.
 
Old 10-08-2006, 04:32 PM   #19
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
I have opted instead to not touch rc.d scripts to handle this, other than rc.local . . .
Good point and thank you for the feedback. One does not need to directly modify the rc.inet1 script at all. I therefore revised that paragraph. Instead simply edit the rc.inet1.conf file, which basically is a container of variables for the rc.inet1 script.
 
Old 10-08-2006, 06:00 PM   #20
ralvy
Member
 
Registered: Nov 2004
Posts: 36

Rep: Reputation: 15
Quote:
Originally Posted by Woodsman
Good point and thank you for the feedback. One does not need to directly modify the rc.inet1 script at all. I therefore revised that paragraph. Instead simply edit the rc.inet1.conf file, which basically is a container of variables for the rc.inet1 script.
I see. I remember thinking about that a while ago and decided I didn't want to have to remember if that particular .conf file was something I would have to examine after an upgradepkg or not. Using rc.local for this just removed one more .conf file I had to deal with. Probably not really the Slack way of doing things, though.
 
Old 10-09-2006, 08:43 AM   #21
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
I also start NTP using a script called from rc.local. My script actually copies a known good version of my configuration file with my localised settings to the active configuration file before launching ntpd. I do this as once NTP is up and running, you can easily forget all about about it, until you lose your configuration with a package update or reinstall.

I do remember to check things occasionally with 'ntpd -p' though!
 
Old 10-09-2006, 08:52 AM   #22
ralvy
Member
 
Registered: Nov 2004
Posts: 36

Rep: Reputation: 15
Quote:
Originally Posted by allend
I also start NTP using a script called from rc.local. My script actually copies a known good version of my configuration file with my localised settings to the active configuration file before launching ntpd. I do this as once NTP is up and running, you can easily forget all about about it, until you lose your configuration with a package update or reinstall.

I do remember to check things occasionally with 'ntpd -p' though!
You can just use ntpd -c and not have to copy over anything at all.
 
Old 10-09-2006, 10:11 PM   #23
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
ralvy
Thanks for the tip. Onbviously were both trying to access the forum at about the same time, otherwise I would not have gotten involved.
 
Old 10-10-2006, 01:32 PM   #24
Michielvw
Member
 
Registered: May 2005
Location: Leicester,UK
Distribution: Slackware
Posts: 108

Rep: Reputation: 19
pretty good mini-howto

would it be perhaps a nice idea to include a logrotate script for ntp as well? not sure how big the ntp.log will become?

secondly, if I want to have other pc's in my lan use my main server for their ntp pooling .. how would I go about that??
 
Old 10-10-2006, 02:27 PM   #25
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
pretty good mini-howto
Thank you.

Quote:
would it be perhaps a nice idea to include a logrotate script for ntp as well? not sure how big the ntp.log will become?
secondly, if I want to have other pc's in my lan use my main server for their ntp pooling .. how would I go about that?
I started to write a response for this thread, but by the time I finished I realized I had created sufficient text to revise the how-to. So please revisit Installing NTP for additional instructions. And thanks for the feedback!

Last edited by Woodsman; 11-10-2006 at 10:46 PM.
 
Old 10-11-2006, 05:58 AM   #26
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 37
Woodsman thanks for your NTP Howto. Hopefully most poeple using dialup via ppp know the script /etc/ppp/ip-up is a good place to call your rc.ntp.

ppd
 
Old 10-11-2006, 05:38 PM   #27
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
Hopefully most poeple using dialup via ppp know the script /etc/ppp/ip-up is a good place to call your rc.ntp.
Noted. Revised. Updated. Thank you!
 
Old 10-13-2006, 11:33 AM   #28
checklist
LQ Newbie
 
Registered: Oct 2006
Location: Springfield, IL
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
When trouble shooting scripts, kernel, etc. I turn off NTP at boot time. ie " Slackware nohotplug nontp "


if grep -wq nontp /proc/cmdline ; then
echo "Not loading NTP damon by request."
else

# startup script here #

fi

Charlie
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with NTP again please!! MaverickApollo Linux - General 2 05-30-2006 07:33 AM
Ntp paul_mat Linux - Software 3 03-02-2006 01:24 AM
Ntp darkkan Debian 3 09-09-2005 11:11 AM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 02:04 PM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration