Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Apr 2011 12:56:58 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Tobias Oberstein <tobias.oberstein@tavendo.de>
Cc:        "freebsd-emulation@freebsd.org" <freebsd-emulation@freebsd.org>
Subject:   Re: AW: rc.d script for running multiple VirtualBox VMs from /etc/rc.conf
Message-ID:  <4DA4AE8A.6020308@FreeBSD.org>
In-Reply-To: <634914A010D0B943A035D226786325D422B76F9205@EXVMBX020-12.exch020.serverdata.net>
References:  <634914A010D0B943A035D226786325D422B76F91CA@EXVMBX020-12.exch020.serverdata.net>	<4DA4A6C7.6050803@FreeBSD.org> <634914A010D0B943A035D226786325D422B76F9205@EXVMBX020-12.exch020.serverdata.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/12/2011 12:35 PM, Tobias Oberstein wrote:
>>> I wanted to configure multiple VirtualBox VMs to startup
>>> automatically at
>> boot time and generally be a nice citizen to the FreeBSD way of
>> starting up stuff.
>>
>> Thanks for providing this, however there are several problems, some
>> of which you outlined in your post.
>>
>> The canonical way to do what you're suggesting is to copy the
>> script so that you have one script per process you want to start,
>> each with a different
>
> I've tried that first .. but for me it gets unwieldy when you need to
> manage i.e. a dozen VMs

I don't see how it would be "unwieldy." The rc.conf stuff would be the 
same, the only difference would be the number of rc.d scripts. What 
problems does having multiple scripts cause for you?

>> 2) when the system shuts down, it doesnt wait for "stop" to finish
>> graceful shutdown of VMs
>
> ?
>
> The problem is, that
>
> VBoxManage controlvm ${vboxvm_name} acpipowerbutton
>
> does exit immediately.
>
> It does not wait until the VM is actually powered down.
>
> Is there i.e. a rc.d "hook" which allows me to make the shutdown
> process wait for some condition (at least up to say a limit of 20s)?

By "shutdown process" are you referring to system shutdown? If so, what 
you probably want to do is modify your _stop method to find the pid of 
the vm and run wait_for_pids() on it. Reading through the comments in 
/etc/rc.subr may be helpful for you in this regard.


Good luck,

Doug

-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DA4AE8A.6020308>