Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93513 - NTP starts AFTER Mythbackend
Summary: NTP starts AFTER Mythbackend
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Television related Applications in Gentoo's Portage
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-22 00:33 UTC by Rod Smart
Modified: 2005-05-22 07:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rod Smart 2005-05-22 00:33:48 UTC
On a dual boot system (mine here with Win-XP & Gentoo) there is a problem if
mythbackend starts before NTP, and the clock has been reset by Windows
Windows sets the HWclock to be local time, Linux sets the HWclock to GMT,
mythbackend starts up with time set to local, knows the clock is running GMT and
changes accordingly, if a program is then supposed to be recording, it begins
recording until the end time appears, the clock then gets changed to GMT and
myth is still waiting for end time, several hours later (possibly be different
the -ve time offset)  myth comes to shutoff time and stops recording

Reproducible: Always
Steps to Reproduce:
1. Install Mythbackend
2. Install NTPd
3. rc-update add ntpd (and mythbackend) same runlevel
4. restart system and change time

Actual Results:  
mythbackend comes alive and starts recording due to time not correctly setup
(changed by MS-Winows) NTP changes time to what it should be, myth continues to
record for the next few hours, in 1 case here, for the next 6 hours until that
channels end time came.

Expected Results:  
in /etc/init.d/mythbackend   add the following....
depend () {
    need ntpd    <- this line so NTPd starts BEFORE myth
    need .....
         }

But this addition should only be included if ntp is included in the use flags,
if not, then someone setting up a PVR with Gentoo and no Internet link, then NTP
will not be either installed or will not work...

The workaround I did was to add the line above (Expected results) and now
mythbackend starts after ntp sets the time
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-05-22 01:21:28 UTC
No, it won
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2005-05-22 01:21:28 UTC
No, it won´t work. NTPd won´t even adjust your clock b/c it´s really wrong
(several hours difference), ntpclient could do this but it is an incorrect
solution (just watch the time leaps in your syslog and consider the other
consequences). Also, ntpd won´t actually work correctly under these
circumstances (it´s time adjustment mechanism is not designed for this). 

Configure Linux and hardware clock to use local time instead of UTC when
dual-booting Windows.
Comment 3 Brian Jackson (RETIRED) gentoo-dev 2005-05-22 07:09:07 UTC
Hah, Jakub beat me to it. Another point to remember is other ntp daemons will
actually try to catch if you force them to. They however won't do it
instantaneously. They like to have a couple of sources that they trust. Which
takes time. And there's no way to make sure they are done setting the time
before mythtv starts. I think this is a problem you need to fix some other way
locally.