diff options
author | Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> | 2018-01-10 00:01:06 +0530 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2018-01-16 21:40:10 -0800 |
commit | bb1465863da8bde10f62fd3a1bbfb981e449dc47 (patch) | |
tree | 7873f98bd176d914b113e856695b4cf19cf0c492 /meta-oe/recipes-support/open-vm-tools/files | |
parent | 7919c886cde4b37fa06df43ef2f898792fd59c7c (diff) | |
download | meta-openembedded-contrib-bb1465863da8bde10f62fd3a1bbfb981e449dc47.tar.gz |
open-vm-tools: add sysvinit script to start vmtoolsd daemon at boot time
It adds support to start vmtoolsd daemon during system startup,
when init manager is SysVinit.
Patch V2 adds option to store pid file in /var/run/vmtoolsd.pid file,
which is helpful to stop/restart vmtoolsd daemon.
Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/open-vm-tools/files')
-rw-r--r-- | meta-oe/recipes-support/open-vm-tools/files/vmtoolsd.init | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/open-vm-tools/files/vmtoolsd.init b/meta-oe/recipes-support/open-vm-tools/files/vmtoolsd.init new file mode 100644 index 0000000000..38280464a7 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/files/vmtoolsd.init @@ -0,0 +1,66 @@ +#!/bin/sh +# +# vmtoolsd Start/stop the vmware tools daemon +# +# chkconfig: 2345 90 60 +# description: vmtoolsd is a daemon that starts up. for some reason, it +# doesn't include a sysv init startup file in the latest release. +# so i have to write this +# + +### BEGIN INIT INFO +# Provides: vmtoolsd +# Required-Start: $local_fs $syslog +# Required-Stop: $local_fs $syslog +# Default-Start: 2345 +# Default-Stop: 90 +# Short-Description: Run vmware tools daemon +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/vmtoolsd +NAME=vmtoolsd +DESC="vmware tools daemon" +VMTOOLSDARGS=" -b /var/run/vmtoolsd.pid " +RETVAL="1" + +# source function library +. /etc/init.d/functions + +test -f $DAEMON || exit 0 + + +case "$1" in + start) + echo -n "Starting vmware tools daemon: " + start-stop-daemon --start --quiet --exec $DAEMON -- $VMTOOLSDARGS + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + stop) + echo -n "Stopping vmware tools daemon: " + start-stop-daemon --stop --quiet --pidfile /var/run/vmtoolsd.pid + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + status) + status vmtoolsd + exit $? + ;; + restart) + $0 stop && sleep 1 && $0 start + ;; + *) + echo "Usage: /etc/init.d/vmtoolsd {start|stop|status|restart}" + exit 1 +esac + +exit $RETVAL |