From 0bef22e73c45f37eb1f9f91fccb58caf4956c910 Mon Sep 17 00:00:00 2001 From: rodri Date: Wed, 20 Oct 2021 20:22:10 +0000 Subject: correct diagnostic output redirections. re-organize the files to make more sense. --- bhyve_coeus | 57 ---------------------------------------------------- bhyve_linux | 57 ---------------------------------------------------- bhyve_test | 57 ---------------------------------------------------- etc/rc.d/bhyve_coeus | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ etc/rc.d/bhyve_linux | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ etc/rc.d/bhyve_test | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 171 insertions(+), 171 deletions(-) delete mode 100755 bhyve_coeus delete mode 100755 bhyve_linux delete mode 100755 bhyve_test create mode 100755 etc/rc.d/bhyve_coeus create mode 100755 etc/rc.d/bhyve_linux create mode 100755 etc/rc.d/bhyve_test diff --git a/bhyve_coeus b/bhyve_coeus deleted file mode 100755 index e6f443a..0000000 --- a/bhyve_coeus +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# $AntaresLabs$ -# - -# PROVIDE: bhyve_coeus -# REQUIRE: DAEMON FILESYSTEMS -# KEYWORD: nojail shutdown - -. /etc/rc.subr - -vmname=coeus -name="bhyve_${vmname}" -desc="Bhyve - ${vmname} VM" -rcvar="${name}_enable" -start_cmd="bhyve_start" -stop_cmd="bhyve_stop" -status_cmd="bhyve_status" -extra_commands="status" - -load_rc_config $name -: ${bhyve_coeus_enable:=NO} - -runvm() -{ - local rc=0 - - while [ $rc -eq 0 ];do - /vmm/machine/${vmname}/run - rc=$? - done -} - -bhyve_start() -{ - runvm & -} - -bhyve_status() -{ - local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') - - if [ ! -z $pid ];then - echo $name is running with pid $pid. 2>&1 - return 0 - else - echo $name is not running. - fi -} - -bhyve_stop() -{ - local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') - kill -TERM $pid -} - -run_rc_command "$1" diff --git a/bhyve_linux b/bhyve_linux deleted file mode 100755 index 117c0e7..0000000 --- a/bhyve_linux +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# $AntaresLabs$ -# - -# PROVIDE: bhyve_linux -# REQUIRE: DAEMON FILESYSTEMS -# KEYWORD: nojail shutdown - -. /etc/rc.subr - -vmname=linux -name="bhyve_${vmname}" -desc="Bhyve - ${vmname} VM" -rcvar="${name}_enable" -start_cmd="bhyve_start" -stop_cmd="bhyve_stop" -status_cmd="bhyve_status" -extra_commands="status" - -load_rc_config $name -: ${bhyve_linux_enable:=NO} - -runvm() -{ - local rc=0 - - while [ $rc -eq 0 ];do - /vmm/machine/${vmname}/run - rc=$? - done -} - -bhyve_start() -{ - runvm & -} - -bhyve_status() -{ - local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') - - if [ ! -z $pid ];then - echo $name is running with pid $pid. 2>&1 - return 0 - else - echo $name is not running. - fi -} - -bhyve_stop() -{ - local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') - kill -TERM $pid -} - -run_rc_command "$1" diff --git a/bhyve_test b/bhyve_test deleted file mode 100755 index a20cf0f..0000000 --- a/bhyve_test +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# $AntaresLabs$ -# - -# PROVIDE: bhyve_test -# REQUIRE: DAEMON FILESYSTEMS -# KEYWORD: nojail shutdown - -. /etc/rc.subr - -vmname=test -name="bhyve_${vmname}" -desc="Bhyve - ${vmname} VM" -rcvar="${name}_enable" -start_cmd="bhyve_start" -stop_cmd="bhyve_stop" -status_cmd="bhyve_status" -extra_commands="status" - -load_rc_config $name -: ${bhyve_test_enable:=NO} - -runvm() -{ - local rc=0 - - while [ $rc -eq 0 ];do - /vmm/machine/${vmname}/run - rc=$? - done -} - -bhyve_start() -{ - runvm & -} - -bhyve_status() -{ - local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') - - if [ ! -z $pid ];then - echo $name is running with pid $pid. 2>&1 - return 0 - else - echo $name is not running. - fi -} - -bhyve_stop() -{ - local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') - kill -TERM $pid -} - -run_rc_command "$1" diff --git a/etc/rc.d/bhyve_coeus b/etc/rc.d/bhyve_coeus new file mode 100755 index 0000000..514616d --- /dev/null +++ b/etc/rc.d/bhyve_coeus @@ -0,0 +1,57 @@ +#!/bin/sh +# +# $AntaresLabs$ +# + +# PROVIDE: bhyve_coeus +# REQUIRE: DAEMON FILESYSTEMS +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +vmname=coeus +name="bhyve_${vmname}" +desc="Bhyve - ${vmname} VM" +rcvar="${name}_enable" +start_cmd="bhyve_start" +stop_cmd="bhyve_stop" +status_cmd="bhyve_status" +extra_commands="status" + +load_rc_config $name +: ${bhyve_coeus_enable:=NO} + +runvm() +{ + local rc=0 + + while [ $rc -eq 0 ];do + /vmm/machine/${vmname}/run + rc=$? + done +} + +bhyve_start() +{ + runvm & +} + +bhyve_status() +{ + local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') + + if [ ! -z $pid ];then + echo $name is running with pid $pid. 1>&2 + return 0 + else + echo $name is not running. 1>&2 + fi +} + +bhyve_stop() +{ + local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') + kill -TERM $pid +} + +run_rc_command "$1" diff --git a/etc/rc.d/bhyve_linux b/etc/rc.d/bhyve_linux new file mode 100755 index 0000000..08a0865 --- /dev/null +++ b/etc/rc.d/bhyve_linux @@ -0,0 +1,57 @@ +#!/bin/sh +# +# $AntaresLabs$ +# + +# PROVIDE: bhyve_linux +# REQUIRE: DAEMON FILESYSTEMS +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +vmname=linux +name="bhyve_${vmname}" +desc="Bhyve - ${vmname} VM" +rcvar="${name}_enable" +start_cmd="bhyve_start" +stop_cmd="bhyve_stop" +status_cmd="bhyve_status" +extra_commands="status" + +load_rc_config $name +: ${bhyve_linux_enable:=NO} + +runvm() +{ + local rc=0 + + while [ $rc -eq 0 ];do + /vmm/machine/${vmname}/run + rc=$? + done +} + +bhyve_start() +{ + runvm & +} + +bhyve_status() +{ + local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') + + if [ ! -z $pid ];then + echo $name is running with pid $pid. 1>&2 + return 0 + else + echo $name is not running. 1>&2 + fi +} + +bhyve_stop() +{ + local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') + kill -TERM $pid +} + +run_rc_command "$1" diff --git a/etc/rc.d/bhyve_test b/etc/rc.d/bhyve_test new file mode 100755 index 0000000..afdcd0e --- /dev/null +++ b/etc/rc.d/bhyve_test @@ -0,0 +1,57 @@ +#!/bin/sh +# +# $AntaresLabs$ +# + +# PROVIDE: bhyve_test +# REQUIRE: DAEMON FILESYSTEMS +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +vmname=test +name="bhyve_${vmname}" +desc="Bhyve - ${vmname} VM" +rcvar="${name}_enable" +start_cmd="bhyve_start" +stop_cmd="bhyve_stop" +status_cmd="bhyve_status" +extra_commands="status" + +load_rc_config $name +: ${bhyve_test_enable:=NO} + +runvm() +{ + local rc=0 + + while [ $rc -eq 0 ];do + /vmm/machine/${vmname}/run + rc=$? + done +} + +bhyve_start() +{ + runvm & +} + +bhyve_status() +{ + local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') + + if [ ! -z $pid ];then + echo $name is running with pid $pid. 1>&2 + return 0 + else + echo $name is not running. 1>&2 + fi +} + +bhyve_stop() +{ + local pid=$(ps axo pid,command | egrep "${vmname}.*\\(bhyve\\)" | awk '{print $1}') + kill -TERM $pid +} + +run_rc_command "$1" -- cgit v1.2.3