Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
05-06-2009, 06:48 AM
|
#1
|
Senior Member
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004
Rep:
|
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack
I run a script on my Linux machines that every night checks if anything has changed in /etc and below and if it has, makes a backup, keeping the last 5 versions.
This way I can check when something stops working if any configuration has changed.
Now I noticed that on one server (running Slackware 12.2 stable) my script said that the configuration changed every day.
Digging in a bit deeper, I found that ntp that runs on that particular box keeps the drift file in /etc/ntp and that file changes daily.
I found some discussions on the internet that this file should be in /var/lib/ntp - which makes sense to me, as it is not a configuration file at all.
I made the change myself (in /etc/ntp.conf) and now my script stops warning me about the new configuration every day.
The official ntp site says the default is /etc/ntp.drift and does not elaborate much on the subject.
The FHS tells us about /etc:
Quote:
The /etc hierarchy contains configuration files. A "configuration file" is a local file used to control the operation of a program; it must be static and cannot be an executable binary.
|
The drift file is definitely not "static".
It tell us about /var:
Quote:
/var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.
|
I vote for changing the ntp drift file to /var/lib/ntp in Slackware.
Should this be changed in the next release of Slackware by including a patched /etc/ntp.conf file?
After all, Slackware seems to follow the FHS quite well.
Last edited by niels.horn; 05-06-2009 at 06:51 AM.
Reason: typos...
|
|
|
05-06-2009, 07:14 AM
|
#2
|
Senior Member
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
|
Hi neils. When I first looked at you post I had to agree as the reasoning behind files in /etc being static makes sense. However that prompted me to have another look at the dates and timestamps of files in there.
Notice there is also the files under /dhcpc and /etc/ld.so.cache which are transient. There are probably others that I haven't noticed yet.
So it would seem some applications do store non-static data in there. Perhaps we are misreading the FHS's meaning on this or perhaps it's just being ignored ?
|
|
|
05-06-2009, 07:21 AM
|
#3
|
Senior Member
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004
Original Poster
Rep:
|
Indeed, there might be others... This is one I noticed
Well, I'd like to hear opinions: should we follow the FHS standard in these cases or not?
|
|
|
05-06-2009, 09:42 AM
|
#4
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
I'm pretty sure that /etc/ld.so.cache is one of those historical exceptions like /etc/mtab is not static. I don't use dhcpc so I'm not sure what files it maintains under /etc.
I also don't use ntp, but from this description:
The drift file is used to record the frequency offset of the local clock oscillator. If the file exists, it is read at startup in order to set the initial frequency offset and then updated once per hour with the current frequency offset computed by the daemon. If the file does not exist or this command is not given, the initial frequency offset is assumed zero. In this case, it may take some hours for the frequency to stabilize and the residual timing errors to subside.
it looks like it gets updated quite a lot. My feeling is that it would be more correctly placed under /var. But I'm not convinced that /var/lib/ntp would be right -it might be more correct under /var/run. But, /var/lib/??? serves as a catchall for other transient, hard-to-define files, so it is probably legal...
|
|
|
05-06-2009, 10:04 AM
|
#5
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,485
|
From the ntp documentation.
Quote:
The ntpd behavior at startup depends on whether the frequency file, usually ntp.drift, exists. This file contains the latest estimate of clock frequency error. When the ntpd is started and the file does not exist, the ntpd enters a special mode designed to quickly adapt to the particular system clock oscillator time and frequency error. This takes approximately 15 minutes, after which the time and frequency are set to nominal values and the ntpd enters normal mode, where the time and frequency are continuously tracked relative to the server. After one hour the frequency file is created and the current frequency offset written to it. When the ntpd is started and the file does exist, the ntpd frequency is initialized from the file and enters normal mode immediately. After that the current frequency offset is written to the file at hourly intervals.
|
So, the ntp.drift file is updated hourly, but over time the data stored within it will become static. It is a file that can fit with either definition.
My opinion is that the decision lies with the upstream developers, who have decided to make /etc/ntp.drift the default. You are free to make a change if you desire.
One of the features of Slackware is that it respects the decisions of the upstream developers. This is usually a good thing, but it is easy to find situations in Slackware where a change in the default configuration can lead to enhanced usability. My pet example here is with xpdf. The default xpdf.rc has entries to point to Windows font files, but these need to changed to point to the default location of these font files in Slackware. This makes xpdf usable for pdf documents developed using Windows fonts. (I know there are better pdf viewers, but xpdf loads up very quickly and I make a lot of use of it for this reason).
I would prefer that Slackware continue with respecting the decisions of the upstream developers.
|
|
|
05-06-2009, 10:07 AM
|
#6
|
Senior Member
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004
Original Poster
Rep:
|
I picked /var/lib/ntp as it seems to be a common solution used in other distros.
I did some googling and found several references to this location.
At least it seems more appropriate than anything under /etc.
I also do not use dhcpc so I have had no conflicts with that one.
/etc/mtab is another situation, as it is "quite static" on most servers.
On desktops it might change a lot though.
I *think* the same goes for /etc/ld.so.cache
|
|
|
05-06-2009, 01:07 PM
|
#7
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
I found some references like this:
ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid
/var/log/ntpstats
/etc/ntpd.conf
/etc/ntp/step-tickers
but also this:
driftfile /var/lib/ntp/drift
|
|
|
05-06-2009, 02:17 PM
|
#8
|
Senior Member
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004
Original Poster
Rep:
|
Quote:
Originally Posted by gnashley
driftfile /var/lib/ntp/drift
|
This is how I did it, putting this line in /etc/ntp.conf
|
|
|
05-06-2009, 05:24 PM
|
#9
|
LQ Veteran
Registered: May 2008
Posts: 7,099
|
I never really cared for the idea of /var/lib/... as unlike /lib, or /usr/lib it doesn't contain libraries so the name just doesn't seem right to me. /var/state as a name seemed far more logical to me, but it looks like the FHS has chosen to go with /var/lib instead. Anyway, despite my nitpicking on the name, I agree with the guys above that the file really doesn't belong in /etc. /var/run doesn't seem to be the right place either, so /var/lib/ntp/ seems like a good choice.
|
|
|
05-06-2009, 06:49 PM
|
#10
|
Senior Member
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004
Original Poster
Rep:
|
Don't worry about the nitpicking. I created this whole thread because I am a nitpicker
I do believe in following standards, as it makes administration of several machines so much simpler...
|
|
|
05-06-2009, 07:19 PM
|
#11
|
LQ Veteran
Registered: May 2008
Posts: 7,099
|
Quote:
Originally Posted by niels.horn
I do believe in following standards, as it makes administration of several machines so much simpler...
|
No argument from me there, I just wish that the 'standards' were a little more logical in places.
|
|
|
05-06-2009, 07:30 PM
|
#12
|
Senior Member
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004
Original Poster
Rep:
|
Yeah I know... And I'll never forget a phrase told to me many, many, years ago:
Quote:
The problem with standards is that there are so many to choose from...
|
|
|
|
05-06-2009, 10:55 PM
|
#13
|
Slackware Contributor
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999
|
Its pretty standard for myself and many others to have /var on it's own partition (and possibly even a network share (unlikely as it may be)) the partition needs to be available when the startup services are run.
I remember dhcpc having issues when someone tried to force a change from /etc to /var for the state files. You want your networking up before trying to mount remote shares after all.
/etc should be on the root partition and is one reason why some of these files reside there. Others (as mentioned) are either just historical or are just the way that upstream do things...
Never take anything at face value as there are often some obscure reasons for things being the way they are.
|
|
|
05-06-2009, 11:53 PM
|
#14
|
Senior Member
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004
Original Poster
Rep:
|
On most professional *nix servers, /var is on its own partition indeed.
Sub-dirs might be on external network shares or storages, but usually not the standard sub-folders like /var/run, /var/lib etc. At least, in my experience.
I respect (most) upstream developers, but my idea of open software is that I am in control.
So if I think that non-static files don't belong in /etc, I'll move them to a better place.
One thing I learned after several decades of working in the IT / support business is not to accept simply what suppliers / upstream developers tell me to do. I question things a lot. And I don't accept answers like "we do it this way because we always did it this way". I am always open for good arguments though.
|
|
|
05-07-2009, 08:37 AM
|
#15
|
Senior Member
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
|
Quote:
etc should be on the root partition and is one reason why some of these files reside there.
|
@mRgOBLIN: Thanks for the information I was wondering about that !
|
|
|
All times are GMT -5. The time now is 12:40 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|