Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Aug 2018 19:04:08 +0000
From:      Paul Vixie <vixie@fsi.io>
To:        Paul Webster <paul.g.webster@googlemail.com>
Cc:        "freebsd-virtua." <freebsd-virtualization@freebsd.org>
Subject:   Re: Query regarding tutorials (Please have a quick read of me!)
Message-ID:  <3626542.UnW4ZVN1pJ@linux-9daj>
In-Reply-To: <CADdqeiPcBm-0Fvu70T3z8-e=SnTMgxx86MH3jRv3v6UNutbZkg@mail.gmail.com>
References:  <CADdqeiO0mGtGuao6t4Nq_Ts4qG6Xqs54C=NzpVKuyyZqPSBAuw@mail.gmail.com> <6699362.kGnQbBhLUH@linux-9daj> <CADdqeiPcBm-0Fvu70T3z8-e=SnTMgxx86MH3jRv3v6UNutbZkg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, August 26, 2018 4:25:13 PM UTC Paul Webster wrote:
> howto start stuff auto:
> https://www.youtube.com/watch?v=MidLqBs4_B8&feature=youtu.be

very entertaining. some notes:

note that rc.local is executed by the "." command from the /bin/sh instance 
that runs /etc/rc.d/local, and so, #! isn't relevant there, nor is "chmod +x".

net.link.ether.inet.proxyall is documented in arp(4) and just means don't drop 
arp requests about addresses that aren't local. i prefer to let the bhyve 
guests answer for themselves, which they'll do, because the arp request is 
sent to the all ones address, and thus reaches all the guests.

i do not use daemon -r for bhyve, because it ignores the the exit status. if 
bhyve exits with 0 i want to loop (recreate bhyve), if it's nonzero i want it 
to exit (poweroff, shutdown, or kernel panic). according to bhyve(8):

> EXIT STATUS
> 
>      Exit status indicates how the VM was terminated:
>      
>      0       rebooted
>      1       powered off
>      2       halted
>      3       triple fault

you might be planning to explain how you interpret these exit statuses in the 
shell script you run from daemon, which in turn starts bhyve. however, it 
looks as if daemon -r only avoids the restart loop if it receives a SIGTERM, 
and i don't know how you'll deliver that. my /etc/rc.local script looks like 
this:

> while true; do
> 
> 	...
> 	
>         # we're using file descriptor #3 to get the bhyve exit code out. 
ugly.
>         set $( ( ( sh vmrun.sh \
>                 -c $cpucount \
>                 -m $memorysize \
>                 -t tap$tapif \
>                 -d /dev/zvol/$zvol \
>                 -C /dev/$cons \
>                 -x \
>                 $@ $vm \
>                 2>&1; \
>           echo $? >&3; ) | logger -t "$tag" ) 3>&1 )
>         bhyve_exit=$1
>         
>         echo === $bhyve_exit
>         if [ "$bhyve_exit" -ne 0 ]; then
>                 break
>         fi
>         
>         sleep 10
> done

-- 
Vixie




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