Revision 473439 that deleted the pre-uninstall stopping of the service also deleted the notification to the host of the removal of tools. This can certainly confuse user of the vCenter console as tools status will show "installed" but "not-running".
Please consider replacing at least this portion of the "preunexec" directive.
@preunexec %%PREFIX%%/bin/vmware-rpctool 'tools.set.version 0' || /usr/bin/true
Would anything need to get set when the tools are installed?
eg: is there a @postexec that would improve the user experience?
There is nothing needed when the tools are installed.
When vmtoolsd begins one of the first handshakes with the host (VMX) is a "tools.set.version nnnnn" indicating the tools version running.
The separate "tools.set.version 0" indicates denotes the is being removed. It signals that vmtoolsd is being intentionally stop and the host should not consider the lack of contact with the guest as an indication that the guest has become unresponsive. We do not want HA configured VMs mistakenly rebooted.
As far as @postexec:
I believe we both agree that there is no harm in (re)starting
the service. I reasonably responsible person would not elect to install open-vm-tools on a guest not running on a VMware hypervisor be it ESXi, WorkStation or Fusion. Even if that happens, the service detects that it is not on a VMware hypervisor and self-terminates.
I believe that most if not all Linux OS releases come with open-vm-tools already installed in the base OS.