commit:     741e4d9a127566fd90531a2565d9628764622176
Author:     Christian Affolter <christian.affolter <AT> stepping-stone <DOT> ch>
AuthorDate: Tue Aug  4 15:10:12 2015 +0000
Commit:     Evan Teran <evan.teran <AT> gmail <DOT> com>
CommitDate: Tue Aug  4 15:10:12 2015 +0000
URL:        https://gitweb.gentoo.org/proj/vmware.git/commit/?id=741e4d9a

Added systemd service support for app-emulation/vmware-player

Created two systemd service unit files according to the existing OpenRC
init script:
* vmware-usbarbitrator.service manages the VMware USB Arbitrator
* vmware-network.service manages the VMware host network

It was decided to split the existing OpenRC init script, in order to
have a better dependency handling and to adhere to Gentoo's
Systemd/Ebuild policy.

 .../vmware-player/files/vmware-network.service          | 17 +++++++++++++++++
 .../vmware-player/files/vmware-usbarbitrator.service    | 11 +++++++++++
 .../vmware-player/vmware-player-7.1.2.2780323.ebuild    |  5 ++++-
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/app-emulation/vmware-player/files/vmware-network.service 
b/app-emulation/vmware-player/files/vmware-network.service
new file mode 100644
index 0000000..abc6648
--- /dev/null
+++ b/app-emulation/vmware-player/files/vmware-network.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=VMware Network
+Requires=local-fs.target
+Wants=network.target vmware-usbarbitrator.service
+After=local-fs.target network.target vmware-usbarbitrator.service
+
+[Service]
+Type=simple
+ExecStartPre=/sbin/modprobe -av vmci vmmon vsock vmblock vmnet
+ExecStart=/opt/vmware/bin/vmware-networks --start 
+ExecStop=/opt/vmware/bin/vmware-networks --stop
+ExecStopPost=/sbin/modprobe -rv vmmon vsock vmblock vmnet vmci
+TimeoutSec=0
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-emulation/vmware-player/files/vmware-usbarbitrator.service 
b/app-emulation/vmware-player/files/vmware-usbarbitrator.service
new file mode 100644
index 0000000..16a0fb8
--- /dev/null
+++ b/app-emulation/vmware-player/files/vmware-usbarbitrator.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=VMware USB Arbitrator
+Requires=local-fs.target
+Before=vmware-network.service
+
+[Service]
+Type=forking
+ExecStart=/opt/vmware/bin/vmware-usbarbitrator
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-emulation/vmware-player/vmware-player-7.1.2.2780323.ebuild 
b/app-emulation/vmware-player/vmware-player-7.1.2.2780323.ebuild
index 0a7ea6a..1dff576 100644
--- a/app-emulation/vmware-player/vmware-player-7.1.2.2780323.ebuild
+++ b/app-emulation/vmware-player/vmware-player-7.1.2.2780323.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-inherit eutils versionator fdo-mime gnome2-utils pax-utils vmware-bundle
+inherit eutils versionator fdo-mime gnome2-utils pax-utils systemd 
vmware-bundle
 
 MY_PN="VMware-Player"
 MY_PV=$(get_version_component_range 1-3)
@@ -206,6 +206,9 @@ src_install() {
                "${FILESDIR}/vmware-11.0.rc" > "${initscript}" || die
        newinitd "${initscript}" vmware || die
 
+       systemd_dounit "${FILESDIR}/vmware-usbarbitrator.service"
+       systemd_dounit "${FILESDIR}/vmware-network.service"
+
        # fill in variable placeholders
        sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
                -i 
"${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}}
 || die

Reply via email to