mirror of
https://git.freebsd.org/ports.git
synced 2025-06-09 23:00:30 -04:00
Make it possible to disable the rc scripts. Still default to enabled, but only when checkvm says we are in a VM. While here, improve scripts slightly. Requested by: mat Tested by: mat
36 lines
805 B
Bash
36 lines
805 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: vmware-guestd
|
|
# REQUIRE: FILESYSTEMS
|
|
# BEFORE: LOGIN
|
|
|
|
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
#
|
|
# vmware_guestd_enable (bool): Set to YES by default.
|
|
# Set it to NO to disable vmware_guestd.
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="vmware_guestd"
|
|
rcvar=vmware_guestd_enable
|
|
|
|
load_rc_config $name
|
|
|
|
checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
|
|
if ${checkvm_cmd} > /dev/null ; then
|
|
: ${vmware_guestd_enable:="YES"}
|
|
else
|
|
: ${vmware_guestd_enable:="NO"}
|
|
fi
|
|
|
|
command="%%PREFIX%%/bin/vmtoolsd"
|
|
pidfile="/var/run/${name}.pid"
|
|
start_precmd="${checkvm_cmd}"
|
|
stop_precmd="${checkvm_cmd}"
|
|
command_args="--background ${pidfile} -c %%PREFIX%%/share/vmware-tools/tools.conf -p %%PREFIX%%/lib/open-vm-tools/plugins/vmsvc"
|
|
|
|
run_rc_command "$1"
|