From 96db85d06ced348309879ddda546fb34e77040cd Mon Sep 17 00:00:00 2001
From: Mike Hibler <hibler@cs.utah.edu>
Date: Thu, 28 Aug 2014 07:39:44 -0600
Subject: [PATCH] exec() the final reboot/halt command so there is not an extra
 level of shell.

Otherwise, the shell will be killed by reboot leading to init restarting it.
Probably does not do any harm other than printing a confusing error message,
but I have seen cases of minorly corrupt root FSes in BSD images.
---
 clientside/tmcc/freebsd/prepare.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/clientside/tmcc/freebsd/prepare.sh b/clientside/tmcc/freebsd/prepare.sh
index 3261b47fed..b2e05cfd6c 100755
--- a/clientside/tmcc/freebsd/prepare.sh
+++ b/clientside/tmcc/freebsd/prepare.sh
@@ -42,8 +42,7 @@ sync
 # XEN vms will just restart, so halt to really stop it. 
 #
 if [ $dohalt -eq 1 ]; then
-    /sbin/halt
+    exec /sbin/halt
 else
-    /sbin/reboot
+    exec /sbin/reboot
 fi
-
-- 
GitLab