aboutsummaryrefslogtreecommitdiffstats
path: root/community/open-vm-tools/open-vm-tools.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-11-23 14:12:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-11-23 14:41:42 +0000
commita28895f56f2ab9233f7ad1b345e07c6249bef1f3 (patch)
tree84d5692bfd48a1c91da1bb1113078093be582b3f /community/open-vm-tools/open-vm-tools.initd
parent00fc18aa0c07998215c7fc55185c63ae496592eb (diff)
downloadaports-a28895f56f2ab9233f7ad1b345e07c6249bef1f3.tar.bz2
aports-a28895f56f2ab9233f7ad1b345e07c6249bef1f3.tar.xz
community/open-vm-tools: move from main
Diffstat (limited to 'community/open-vm-tools/open-vm-tools.initd')
-rw-r--r--community/open-vm-tools/open-vm-tools.initd67
1 files changed, 67 insertions, 0 deletions
diff --git a/community/open-vm-tools/open-vm-tools.initd b/community/open-vm-tools/open-vm-tools.initd
new file mode 100644
index 0000000000..fab4d22a39
--- /dev/null
+++ b/community/open-vm-tools/open-vm-tools.initd
@@ -0,0 +1,67 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: $VM_DRAG_AND_DROP is here for backward compatibility.
+: ${vm_drag_and_drop:="${VM_DRAG_AND_DROP:-}"}
+
+command="/usr/bin/vmtoolsd"
+command_background="yes"
+pidfile="/run/vmtoolsd.pid"
+# To not complain about missing messages...
+start_stop_daemon_args="--env LANG=en_US.UTF-8"
+
+vmblockmntpt="/proc/fs/vmblock/mountPoint"
+vmblockfusemntpt="/run/vmblock-fuse"
+
+depend() {
+ before net X
+}
+
+start_vmblock() {
+ checkpath -d -m 1777 /tmp/VMwareDnD
+
+ if command -v vmware-vmblock-fuse > /dev/null; then
+ modprobe fuse > /dev/null 2>&1
+ checkpath -d "$vmblockfusemntpt"
+
+ ebegin "Mounting vmblock-fuse"
+ vmware-vmblock-fuse \
+ -o subtype=vmware-vmblock,default_permissions,allow_other \
+ "$vmblockfusemntpt"
+ eend $?
+ else
+ modprobe vmblock > /dev/null 2>&1
+ checkpath -d "$vmblockmntpt"
+
+ ebegin "Mounting vmblock"
+ mount -t vmblock vmblock "$vmblockmntpt"
+ eend $?
+ fi
+}
+
+stop_vmblock() {
+ if [ -d "$vmblockfusemntpt" ]; then
+ ebegin "Unmounting vmblock-fuse"
+ umount "$vmblockfusemntpt"
+ eend $?
+ else
+ ebegin "Unmounting vmblock"
+ umount "$vmblockmntpt"
+ eend $?
+ fi
+}
+
+start_pre() {
+ if [ "$vm_drag_and_drop" = yes ]; then
+ start_vmblock
+ fi
+ return 0
+}
+
+stop_post() {
+ if [ "$vm_drag_and_drop" = yes ]; then
+ stop_vmblock
+ fi
+ return 0
+}