Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 203334 - baselayout-1: problem with init.d/clock vs OpenVZ
Summary: baselayout-1: problem with init.d/clock vs OpenVZ
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-25 21:30 UTC by Kir Kolyshkin
Modified: 2008-01-14 08:43 UTC (History)
0 users

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


Attachments
proposed fix (tested on my system) (baselayout-1.12.10-fix-openvz-clock.patch,1.07 KB, patch)
2007-12-25 21:32 UTC, Kir Kolyshkin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kir Kolyshkin 2007-12-25 21:30:30 UTC
Hi,

I have recently found a problem in baselayout (baselayout-1.12.10-r5 has it).
This is an excerpt from /etc/init.d/clock:

        elif is_vserver_sys ; then
                TBLURB="VServer"
                fakeit=1
        elif is_xenU_sys ; then
                TBLURB="xen"
                fakeit=1
        elif [[ -d /proc/vz ]] ; then
                TBLURB="VZ"
                fakeit=1

The script checks if the system is some kind of a virtual server, and skips setting the system time in case it is. The problem here is /proc/vz exists even in VE0 (the host system itself, somewhat similar to Xen's Dom0), but the test is supposed to only catch the case we are inside a container (VPS, VE).

This created a big problem on my laptop since I use CLOCK="local" -- somehow when clock starts openvz modules are NOT loaded yet, and then it stops openvz modules are loaded. This leads to 3 hours (my timezone is GMT+3) skew on every reboot. Really really annoying, and I think quite critical.

I will attach the patch that fixes the issue.

Note that baselayout-2.0.0_rc6 is not vulnerable -- from what I see in its code it does the right checks.

Reproducible: Always

Steps to Reproduce:
Comment 1 Kir Kolyshkin 2007-12-25 21:32:12 UTC
Created attachment 139315 [details, diff]
proposed fix (tested on my system)

I plea for this fix to be included into next baselayout-1.12 update -- screwing the clock does weird things...
Comment 2 Benedikt Böhm (RETIRED) gentoo-dev 2007-12-26 23:01:54 UTC
baselayout-1 is not usable in vservers, baselayout-vserver is not supported anymore...
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2007-12-27 11:53:02 UTC
This bug is about host system so it baselayout should work there.
Comment 4 SpanKY gentoo-dev 2007-12-27 19:25:46 UTC
it's already fixed in baselayout-2
Comment 5 SpanKY gentoo-dev 2008-01-14 08:43:08 UTC
added for 1.12.11