Thoughts on solution to 1970-ness

Talk about the project itself, the community, where we are and what we need. Great place to introduce yourself and make friends as well.

Thoughts on solution to 1970-ness

Postby phillid » Sun Jul 20, 2014 8:20 am

Hi all.
With no RTC, I'd gotten quite tired of systemd saying that the system's been up for forty four years and the scattered log entries + files from 1970. NTPd was already configured perfectly, but it never ended up setting the time until most other services had started and started logging with bogus dates. Gah. I did a quick Google search to see if I could hold all systemd services from running (except ntpd's dependencies) until NTP had completed.... Even then, that'd still mean that systemd and a few selected services would have been running for 44 years... I'd still have log entries and files from 1970.

I ended up coming up with a small shell script which I execute as my init. It enables a network interface using dhcpcd, runs ntpd, leaves no trace it was ever there (except for an optional log) and calls `/sbin/init`. I'm quite pleased with it, except the fact that I'm not just using `init=/usr/bin/init` (semi-tacky IMO). Aside from that, it's as it there's an RTC. One issue I'm aware of are that devices like USB wifi adapters won't be able to be used. Also, it doesn't officially support setups where a DHCP server isn't present (you'd have to rely on dhcpcd's fallback profile).

I decided it's about time to put it in the AUR, but I was just wondering what y'all think of this solution, and how/if others have tackled this problem?


EDIT: With a bit of searching on the forums, I found a pretty-much-identical approach
Last edited by phillid on Sun Jul 20, 2014 10:00 am, edited 2 times in total.
phillid
 
Posts: 6
Joined: Mon Apr 28, 2014 4:55 am

Re: Thoughts on solution to 1970-ness

Postby pepedog » Sun Jul 20, 2014 8:48 am

Did you look at fake-hwclock?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Thoughts on solution to 1970-ness

Postby phillid » Sun Jul 20, 2014 9:09 am

Yeah, I did read about fake-hwclock, but I'm too much of a time and date perfectionist for something of that sort :P It wouldn't be accurate enough. I would use fake-hwclock if I only ever powered-off for a few minutes at a time, where the bogus-ness of the faked time wouldn't be significant. However I often have certain machines powered off for days on end, so while fake-hwclock would save be from being stuck in the year 1970, it would still make the logs look funny.

Like I said, I'm a time and date perfectionist :P
phillid
 
Posts: 6
Joined: Mon Apr 28, 2014 4:55 am

Re: Thoughts on solution to 1970-ness

Postby nwestfal » Wed Sep 17, 2014 5:18 pm

Aside from the inaccuracy, fake-hwclock doesn't seem to be a complete solution, as I note in my logs that some services get started up before fake-hwclock runs.
-Neal
nwestfal
 
Posts: 30
Joined: Wed Sep 03, 2014 11:24 pm


Return to Community

Who is online

Users browsing this forum: No registered users and 1 guest