diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-05-22 16:27:58 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-05-22 20:06:17 -0500 |
commit | c625abdb5f8b5a58059517c69e6ddebfd6b9710e (patch) | |
tree | bbeb335c3c8a351118ffc2838c0cd0bf1d3216d4 /user/open-vm-tools/open-vm-tools.initd | |
parent | b264031d6c87b70151b3c4c93b8d029cf7a903e6 (diff) | |
download | packages-c625abdb5f8b5a58059517c69e6ddebfd6b9710e.tar.gz packages-c625abdb5f8b5a58059517c69e6ddebfd6b9710e.tar.bz2 packages-c625abdb5f8b5a58059517c69e6ddebfd6b9710e.tar.xz packages-c625abdb5f8b5a58059517c69e6ddebfd6b9710e.zip |
user/open-vm-tools: New package
Diffstat (limited to 'user/open-vm-tools/open-vm-tools.initd')
-rw-r--r-- | user/open-vm-tools/open-vm-tools.initd | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/user/open-vm-tools/open-vm-tools.initd b/user/open-vm-tools/open-vm-tools.initd new file mode 100644 index 000000000..244a951e4 --- /dev/null +++ b/user/open-vm-tools/open-vm-tools.initd @@ -0,0 +1,60 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +pidfile="/run/vmtoolsd.pid" +command="/usr/bin/vmtoolsd" +command_args="-b ${pidfile}" + +vmblockmntpt="/proc/fs/vmblock/mountPoint" +vmblockfusemntpt="/run/vmblock-fuse" + +depend() { + before checkfs fsck net X + want vgauthd +} + +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 [ x"${VM_DRAG_AND_DROP}" = xyes ]; then + start_vmblock + fi + return 0 +} + +stop_post() { + if [ x"${VM_DRAG_AND_DROP}" = xyes ]; then + stop_vmblock + fi + return 0 +} |