From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Apr 19 22:40:04 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48B12106566B for ; Tue, 19 Apr 2011 22:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 212DB8FC0C for ; Tue, 19 Apr 2011 22:40:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p3JMe3DZ064254 for ; Tue, 19 Apr 2011 22:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3JMe3eL064253; Tue, 19 Apr 2011 22:40:03 GMT (envelope-from gnats) Resent-Date: Tue, 19 Apr 2011 22:40:03 GMT Resent-Message-Id: <201104192240.p3JMe3eL064253@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Artem Naluzhnyy Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD874106564A for ; Tue, 19 Apr 2011 22:39:51 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 9108E8FC17 for ; Tue, 19 Apr 2011 22:39:51 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p3JMdpWa078645 for ; Tue, 19 Apr 2011 22:39:51 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p3JMdoEt078644; Tue, 19 Apr 2011 22:39:51 GMT (envelope-from nobody) Message-Id: <201104192239.p3JMdoEt078644@red.freebsd.org> Date: Tue, 19 Apr 2011 22:39:51 GMT From: Artem Naluzhnyy To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/156508: [PATCH] emulators/virtualbox-ose-additions: deal with gues OS time sync X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2011 22:40:04 -0000 >Number: 156508 >Category: ports >Synopsis: [PATCH] emulators/virtualbox-ose-additions: deal with gues OS time sync >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Apr 19 22:40:03 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Artem Naluzhnyy >Release: >Organization: >Environment: >Description: Add pkg-message and modify "vboxservice" rc-script accordingly to prevent simultaneous time synchronization by VirtualBox Additions and ntpd. +------------------------------------------------------------------------------ To run VirtualBox Additions from startup, add the following in /etc/rc.conf: vboxguest_enable="YES" vboxservice_enable="YES" To prevent time source conflict, both ntpd(8) and ntpdate(8) must be disabled in rc.conf while VirtualBox Additions are in use. You may use ntpd in your host OS instead. If you still wish to use ntpd in guest OS you should disable time sync by the VirtualBox Additions - add extra lines in your in /etc/rc.conf: vboxservice_flags="--disable-timesync" vboxservice_ignore_ntpd="YES" +------------------------------------------------------------------------------ This should fix the problems like Apr 17 13:37:55 devel ntpd[757]: time reset -0.886552 s Apr 17 13:54:01 devel ntpd[757]: time reset -0.968916 s Apr 17 14:10:15 devel ntpd[757]: time reset -0.935790 s Apr 17 14:26:29 devel ntpd[757]: time reset -0.982373 s Apr 17 15:02:07 devel ntpd[757]: time reset -0.940596 s Apr 17 15:02:16 devel ntpd[757]: time correction of -1200 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time. if host OS time is not synchronized properly. >How-To-Repeat: >Fix: diff -ruN virtualbox-ose-additions.bak/Makefile virtualbox-ose-additions/Makefile --- virtualbox-ose-additions.bak/Makefile 2011-01-31 23:06:45.000000000 +0000 +++ virtualbox-ose-additions/Makefile 2011-04-19 21:57:57.000000000 +0000 @@ -7,7 +7,7 @@ PORTNAME= virtualbox-ose DISTVERSION= 3.2.12 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= emulators kld MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ @@ -177,4 +177,7 @@ ${PREFIX}/share/hal/fdi/policy/10osvendor/ .endif +post-install: + @${CAT} ${PKGMESSAGE} + .include diff -ruN virtualbox-ose-additions.bak/files/vboxservice.in virtualbox-ose-additions/files/vboxservice.in --- virtualbox-ose-additions.bak/files/vboxservice.in 2011-01-31 23:06:45.000000000 +0000 +++ virtualbox-ose-additions/files/vboxservice.in 2011-04-19 21:43:06.000000000 +0000 @@ -3,7 +3,7 @@ # $FreeBSD: ports/emulators/virtualbox-ose-additions/files/vboxservice.in,v 1.1 2011/01/31 23:06:45 decke Exp $ # PROVIDE: vboxservice -# REQUIRE: DAEMON vboxguest +# REQUIRE: DAEMON vboxguest ntpdate ntpd # BEFORE: LOGIN # KEYWORD: shutdown @@ -11,16 +11,36 @@ # # vboxservice_enable (bool): Set to "NO" by default. # Set it to "YES" to enable VBoxService. +# +# vboxservice_ignore_ntpd (bool): Set to "NO" by default. +# Set it to "YES" to allow VBoxService start +# with ntpd running . /etc/rc.subr name="vboxservice" rcvar=`set_rcvar` command="%%PREFIX%%/sbin/VBoxService" +start_precmd="vboxservice_prestart" load_rc_config $name : ${vboxservice_enable="NO"} : ${vboxservice_flags=""} +: ${vboxservice_ignore_ntpd="NO"} +: ${ntpd_enable="NO"} +: ${ntpdate_enable="NO"} + +vboxservice_prestart() +{ + if checkyesno ntpd_enable || checkyesno ntpdate_enable; then + if checkyesno vboxservice_ignore_ntpd; then + return 0 + else + err 1 "To prevent time source conflict, ntpd(8) and \ +ntpdate(8) must be disabled in rc.conf while VirtualBox Additions are in use." + fi + fi +} run_rc_command "$1" diff -ruN virtualbox-ose-additions.bak/pkg-message virtualbox-ose-additions/pkg-message --- virtualbox-ose-additions.bak/pkg-message 1970-01-01 00:00:00.000000000 +0000 +++ virtualbox-ose-additions/pkg-message 2011-04-19 22:18:41.000000000 +0000 @@ -0,0 +1,18 @@ + +------------------------------------------------------------------------------ +To run VirtualBox Additions from startup, add the following in /etc/rc.conf: + + vboxguest_enable="YES" + vboxservice_enable="YES" + +To prevent time source conflict, both ntpd(8) and ntpdate(8) must be disabled +in rc.conf while VirtualBox Additions are in use. You may use ntpd in your +host OS instead. + +If you still wish to use ntpd in guest OS you should disable time sync by +the VirtualBox Additions - add extra lines in your in /etc/rc.conf: + + vboxservice_flags="--disable-timesync" + vboxservice_ignore_ntpd="YES" + +------------------------------------------------------------------------------ >Release-Note: >Audit-Trail: >Unformatted: