vmware-server-12.1.rc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2013 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. depend() {
  5. need localmount vmware
  6. use net
  7. }
  8. checkconfig() {
  9. # Check if certificates exist. If not, we need to generate them, ala sshd.
  10. if [ ! -e @@ETCDIR@@/ssl/rui.key -o ! -e @@ETCDIR@@/ssl/rui.crt ]; then
  11. mkdir -p @@ETCDIR@@/ssl
  12. openssl req -x509 -days 365 -newkey rsa:2048 -keyout @@ETCDIR@@/ssl/rui.key -out @@ETCDIR@@/ssl/rui.crt -config @@ETCDIR@@/ssl/hostd.ssl.config
  13. chmod -R 600 @@ETCDIR@@/ssl
  14. fi
  15. }
  16. start() {
  17. checkconfig
  18. ebegin Starting VMware Authentication Daemon
  19. start-stop-daemon --start \
  20. --exec @@PREFIX@@/sbin/vmware-authdlauncher
  21. eend $?
  22. ebegin Starting VMware Workstation Server
  23. start-stop-daemon --start \
  24. --pidfile /var/run/vmware/vmware-hostd.PID \
  25. --exec @@BINDIR@@/vmware-hostd \
  26. -- -a -d @@ETCDIR@@/hostd/config.xml
  27. eend $?
  28. }
  29. stop() {
  30. ebegin "Shutdown VMs in the AutoStart Sequence"
  31. local HOHO_ADMIN="$(@@BINDIR@@/vmware-wssc-adminTool "@@ETCDIR@@/hostd/authorization.xml" 2>/dev/null)"
  32. if [ "x" != "x${HOHO_ADMIN}" ]; then
  33. @@BINDIR@@/vmware-vim-cmd -U "${HOHO_ADMIN}" hostsvc/autostartmanager/autostop
  34. fi
  35. eend $?
  36. ebegin Stopping VMware Workstation Server
  37. start-stop-daemon --stop \
  38. --pidfile /var/run/vmware/vmware-hostd.PID \
  39. --exec @@BINDIR@@/vmware-hostd
  40. eend $?
  41. ebegin Stopping VMware Authentication Daemon
  42. #start-stop-daemon --stop \
  43. # --exec @@PREFIX@@/sbin/vmware-authdlauncher
  44. killall @@PREFIX@@/sbin/vmware-authdlauncher
  45. eend $?
  46. }