diff --git a/open-vm-tools.spec b/open-vm-tools.spec index df15559..e09d574 100644 --- a/open-vm-tools.spec +++ b/open-vm-tools.spec @@ -28,7 +28,7 @@ Name: open-vm-tools Version: %{toolsversion} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Open Virtual Machine Tools for virtual machines hosted on VMware Group: Applications/System License: GPLv2 @@ -212,12 +212,6 @@ install -p -m 644 -D %{SOURCE2} %{buildroot}%{_unitdir}/%{vgauthdaemon}.service # upstream %post -if [ -f %{_bindir}/vmware-guestproxycerttool ]; then - mkdir -p %{_sysconfdir}/vmware-tools/GuestProxyData/server - mkdir -p -m 0700 %{_sysconfdir}/vmware-tools/GuestProxyData/trusted - %{_bindir}/vmware-guestproxycerttool -g &> /dev/null || /bin/true -fi - # Setup mount point for Shared Folders # NOTE: Use systemd-detect-virt to detect VMware platform because # vmware-checkvm might misbehave on non-VMware platforms. @@ -253,16 +247,14 @@ if [ "$1" = "0" -a \ umount /mnt/hgfs &> /dev/null || /bin/true rmdir /mnt/hgfs &> /dev/null || /bin/true fi + + # Cleanup GuestProxy certs + %{_bindir}/vmware-guestproxycerttool -e &> /dev/null || /bin/true fi %postun %systemd_postun_with_restart %{toolsdaemon}.service %systemd_postun_with_restart %{vgauthdaemon}.service -# Cleanup GuestProxy certs if open-vm-tools is being uninstalled -if [ "$1" = "0" ]; then - rm -rf %{_sysconfdir}/vmware-tools/GuestProxyData &> /dev/null || /bin/true - rm -rf %{_sysconfdir}/vmware-tools &> /dev/null || /bin/true -fi %files %{!?_licensedir:%global license %%doc} @@ -328,6 +320,11 @@ fi %{_bindir}/vmware-vgauth-smoketest %changelog +* Tue Aug 07 2018 Ravindra Kumar - 10.3.0-3 +- Implement the https://pagure.io/packaging-committee/issue/506 guideline. +- Added vmtoolsd-init.service per the guideline. +- Replaced the certificate cleanup with "vmware-guestproxycerttool -e". + * Mon Aug 06 2018 Ravindra Kumar - 10.3.0-2 - Added hgfsPlugin-crash.patch for vmtoolsd crash (RHBZ#1612470). diff --git a/vmtoolsd-init.service b/vmtoolsd-init.service new file mode 100644 index 0000000..08dd10d --- /dev/null +++ b/vmtoolsd-init.service @@ -0,0 +1,14 @@ +[Unit] +Description=One-time configuration for vmtoolsd +ConditionVirtualization=vmware +ConditionPathExists=|!/etc/vmware-tools/GuestProxyData/server/cert.pem +ConditionPathExists=|!/etc/vmware-tools/GuestProxyData/server/key.pem +PartOf=vmtoolsd.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/vmware-guestproxycerttool -g + +[Install] +RequiredBy=vmtoolsd.service diff --git a/vmtoolsd.service b/vmtoolsd.service index 54c7312..a6a8c18 100644 --- a/vmtoolsd.service +++ b/vmtoolsd.service @@ -2,7 +2,9 @@ Description=Service for virtual machines hosted on VMware Documentation=http://github.com/vmware/open-vm-tools ConditionVirtualization=vmware +Requires=vmtoolsd-init.service Requires=vgauthd.service +After=vmtoolsd-init.service After=vgauthd.service [Service] @@ -11,4 +13,5 @@ TimeoutStopSec=5 [Install] WantedBy=multi-user.target +Also=vmtoolsd-init.service Also=vgauthd.service