mirror of
https://git.freebsd.org/ports.git
synced 2025-06-16 10:10:31 -04:00
- Fix on !x86 bhyve: multiple NICs support bhyve: ability to specify MAC address per NIC (bugfix) jail2iso: prohibit EFI boot loader on systems that do not have /boot/loader.efi (Reported by: Victor Kraft) (bugfix) bhyve: Fixed bug from 10.1.3 - bad handler when creating a virtual machine from Jail jorder: restore functional PR: 197051 Submitted by: olevole@olevole.ru (maintainer)
87 lines
1.4 KiB
Bash
87 lines
1.4 KiB
Bash
#!/bin/sh
|
|
#
|
|
# PROVIDE: cbsdd
|
|
# REQUIRE: LOGIN FILESYSTEMS sshd
|
|
# KEYWORD: shutdown
|
|
#
|
|
# cbsdd_enable="YES"
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=cbsdd
|
|
rcvar=cbsdd_enable
|
|
load_rc_config $name
|
|
|
|
: ${cbsdd_enable="NO"}
|
|
|
|
export workdir="${cbsd_workdir}"
|
|
export NO_CBSD_HISTORY=yes
|
|
globalconf=${cbsd_globalconf:-"${workdir}/cbsd.conf"}
|
|
|
|
if [ ! -f ${globalconf} ]; then
|
|
echo "cbsd: no such ${globalconf}";
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f ${mdtools} ]; then
|
|
echo "cbsd: no such ${mdtools}";
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f ${subr} ]; then
|
|
echo "cbsd: no such ${subr}";
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f ${localcbsdconf} ]; then
|
|
echo "cbsd: no such ${localcbsdconf}";
|
|
exit 1
|
|
fi
|
|
|
|
. ${globalconf}
|
|
. ${mdtools}
|
|
. ${subr}
|
|
|
|
. ${localcbsdconf}
|
|
|
|
start_precmd=${name}_prestart
|
|
stop_precmd=${name}_prestop
|
|
stop_cmd=${name}_stop
|
|
reload_cmd=${name}_reload
|
|
extra_commands="reload"
|
|
|
|
command="${toolsdir}/cbsdd"
|
|
pidfile="/var/run/$name.pid"
|
|
command_args="&"
|
|
|
|
cbsdd_prestart() {
|
|
%%PREFIX%%/bin/cbsd task mode=flushall > /dev/null 2>&1
|
|
%%PREFIX%%/bin/cbsd sysinv mode=update
|
|
%%PREFIX%%/bin/cbsd netinv
|
|
|
|
. ${inventory}
|
|
|
|
[ -n "$nat_enable" ] && %%PREFIX%%/bin/cbsd naton
|
|
/usr/sbin/daemon -f ${rcddir}/jails-astart start
|
|
}
|
|
|
|
cbsdd_prestop()
|
|
{
|
|
${rcddir}/jails-astart stop
|
|
[ -n "${nat_enable}" ] && %%PREFIX%%/bin/cbsd natoff
|
|
}
|
|
|
|
cbsdd_stop()
|
|
{
|
|
[ -f "${pidfile}" ] && kill -9 $( cat ${pidfile} )
|
|
}
|
|
|
|
cbsdd_reload()
|
|
{
|
|
[ -f "${pidfile}" ] && kill -9 $( cat ${pidfile} ) > /dev/null 2>&1
|
|
run_rc_command "start"
|
|
exit 0
|
|
}
|
|
|
|
run_rc_command "$1"
|