summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorJagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>2018-01-10 00:01:06 +0530
committerArmin Kuster <akuster808@gmail.com>2018-01-16 21:40:10 -0800
commitbb1465863da8bde10f62fd3a1bbfb981e449dc47 (patch)
tree7873f98bd176d914b113e856695b4cf19cf0c492 /meta-oe
parent7919c886cde4b37fa06df43ef2f898792fd59c7c (diff)
downloadmeta-openembedded-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')
-rw-r--r--meta-oe/recipes-support/open-vm-tools/files/vmtoolsd.init66
-rw-r--r--meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.1.5.bb17
2 files changed, 80 insertions, 3 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 000000000..38280464a
--- /dev/null
+++ b/meta-oe/recipes-support/open-vm-tools/files/vmtoolsd.init
@@ -0,0 +1,66 @@
1#!/bin/sh
2#
3# vmtoolsd Start/stop the vmware tools daemon
4#
5# chkconfig: 2345 90 60
6# description: vmtoolsd is a daemon that starts up. for some reason, it
7# doesn't include a sysv init startup file in the latest release.
8# so i have to write this
9#
10
11### BEGIN INIT INFO
12# Provides: vmtoolsd
13# Required-Start: $local_fs $syslog
14# Required-Stop: $local_fs $syslog
15# Default-Start: 2345
16# Default-Stop: 90
17# Short-Description: Run vmware tools daemon
18### END INIT INFO
19
20PATH=/sbin:/bin:/usr/sbin:/usr/bin
21DAEMON=/usr/bin/vmtoolsd
22NAME=vmtoolsd
23DESC="vmware tools daemon"
24VMTOOLSDARGS=" -b /var/run/vmtoolsd.pid "
25RETVAL="1"
26
27# source function library
28. /etc/init.d/functions
29
30test -f $DAEMON || exit 0
31
32
33case "$1" in
34 start)
35 echo -n "Starting vmware tools daemon: "
36 start-stop-daemon --start --quiet --exec $DAEMON -- $VMTOOLSDARGS
37 RETVAL=$?
38 if [ $RETVAL -eq 0 ] ; then
39 echo "OK"
40 else
41 echo "FAIL"
42 fi
43 ;;
44 stop)
45 echo -n "Stopping vmware tools daemon: "
46 start-stop-daemon --stop --quiet --pidfile /var/run/vmtoolsd.pid
47 RETVAL=$?
48 if [ $RETVAL -eq 0 ] ; then
49 echo "OK"
50 else
51 echo "FAIL"
52 fi
53 ;;
54 status)
55 status vmtoolsd
56 exit $?
57 ;;
58 restart)
59 $0 stop && sleep 1 && $0 start
60 ;;
61 *)
62 echo "Usage: /etc/init.d/vmtoolsd {start|stop|status|restart}"
63 exit 1
64esac
65
66exit $RETVAL
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.1.5.bb b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.1.5.bb
index 81e8e9624..c32d2c5b3 100644
--- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.1.5.bb
+++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.1.5.bb
@@ -24,6 +24,7 @@ LICENSE_modules/solaris = "CDDL-1.0"
24SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \ 24SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \
25 file://tools.conf \ 25 file://tools.conf \
26 file://vmtoolsd.service \ 26 file://vmtoolsd.service \
27 file://vmtoolsd.init \
27 file://0001-configure.ac-don-t-use-dnet-config.patch \ 28 file://0001-configure.ac-don-t-use-dnet-config.patch \
28 file://0002-add-include-sys-sysmacros.h.patch \ 29 file://0002-add-include-sys-sysmacros.h.patch \
29 file://0001-Remove-assumptions-about-glibc-being-only-libc-imple.patch \ 30 file://0001-Remove-assumptions-about-glibc-being-only-libc-imple.patch \
@@ -50,7 +51,7 @@ DEPENDS_append_libc-musl = " libtirpc"
50# open-vm-tools is supported only on x86. 51# open-vm-tools is supported only on x86.
51COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' 52COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux'
52 53
53inherit autotools pkgconfig systemd 54inherit autotools pkgconfig systemd update-rc.d
54 55
55SYSTEMD_SERVICE_${PN} = "vmtoolsd.service" 56SYSTEMD_SERVICE_${PN} = "vmtoolsd.service"
56 57
@@ -85,8 +86,14 @@ RDEPENDS_${PN} = "util-linux libdnet fuse"
85 86
86do_install_append() { 87do_install_append() {
87 ln -sf ${sbindir}/mount.vmhgfs ${D}/sbin/mount.vmhgfs 88 ln -sf ${sbindir}/mount.vmhgfs ${D}/sbin/mount.vmhgfs
88 install -d ${D}${systemd_unitdir}/system ${D}${sysconfdir}/vmware-tools 89 install -d ${D}${sysconfdir}/vmware-tools
89 install -m 644 ${WORKDIR}/*.service ${D}${systemd_unitdir}/system 90 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
91 install -d ${D}${systemd_unitdir}/system
92 install -m 644 ${WORKDIR}/*.service ${D}${systemd_unitdir}/system
93 else
94 install -d ${D}${sysconfdir}/init.d
95 install -m 0755 ${WORKDIR}/vmtoolsd.init ${D}${sysconfdir}/init.d/vmtoolsd
96 fi
90 install -m 0644 ${WORKDIR}/tools.conf ${D}${sysconfdir}/vmware-tools/tools.conf 97 install -m 0644 ${WORKDIR}/tools.conf ${D}${sysconfdir}/vmware-tools/tools.conf
91} 98}
92 99
@@ -95,6 +102,10 @@ do_configure_prepend() {
95 export CUSTOM_DNET_LIBS=-L${STAGING_LIBDIR}/libdnet.so 102 export CUSTOM_DNET_LIBS=-L${STAGING_LIBDIR}/libdnet.so
96} 103}
97 104
105INITSCRIPT_PACKAGES = "${PN}"
106INITSCRIPT_NAME_${PN} = "vmtoolsd"
107INITSCRIPT_PARAMS_${PN} = "start 90 2 3 4 5 . stop 60 0 1 6 ."
108
98python() { 109python() {
99 if 'networking-layer' not in d.getVar('BBFILE_COLLECTIONS').split() or \ 110 if 'networking-layer' not in d.getVar('BBFILE_COLLECTIONS').split() or \
100 'filesystems-layer' not in d.getVar('BBFILE_COLLECTIONS').split(): 111 'filesystems-layer' not in d.getVar('BBFILE_COLLECTIONS').split():