ports/emulators/open-vm-tools/files/vmware-guestd.in
Geoff Davis 8f9a376fdf emulators/open-vm-tools: Fix vmware-guestd rc
Add eval to the call to ${checkvm_cmd} to make sure stdout/stderr are
redirect to /dev/null and remove spurious output when it's executed

PR:		266520
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-10-03 14:55:12 -03:00

33 lines
797 B
Bash

#!/bin/sh
# PROVIDE: vmware-guestd
# REQUIRE: FILESYSTEMS ldconfig
# 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 2>&1"
if eval "${checkvm_cmd}"; 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"