Browse code

Add vgauthd service to open-vm-tools

Change-Id: I2393b31e0700ecb7678f980aca357e12567a0585
Reviewed-on: http://photon-jenkins.eng.vmware.com/500
Tested-by: jenkins-photon <wangnan2015@hotmail.com>
Reviewed-by: suezzelur <anishs@vmware.com>

suezzelur authored on 2016/02/04 10:09:25
Showing 3 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	Usermode tools for VmWare virts
2 2
 Name:		open-vm-tools
3 3
 Version:	10.0.5
4
-Release:	2%{?dist}
4
+Release:	3%{?dist}
5 5
 License:	LGPLv2+
6 6
 URL:		https://github.com/vmware/open-vm-tools
7 7
 Group:		Applications/System
... ...
@@ -11,6 +11,8 @@ Source0:    https://github.com/vmware/open-vm-tools/archive/%{name}-%{version}.t
11 11
 %define sha1 open-vm-tools=9d29a17cce539b032317d0a8c55977666daa137e
12 12
 Source1:        gosc-scripts.tar.gz
13 13
 %define sha1 gosc-scripts=a87bb5b95f78923ac6053513b3364a119795a5d0
14
+Source2:        vmtoolsd.service
15
+Source3:        vgauthd.service
14 16
 Patch0:		open-vm-tools-service-link.patch
15 17
 Patch1:         open-vm-tools-GOSC-photon.patch
16 18
 Patch2:         GOSC-VCA.patch
... ...
@@ -65,23 +67,8 @@ make %{?_smp_mflags}
65 65
 install -vdm 755 %{buildroot}/lib/systemd/system
66 66
 install -vdm 755 %{buildroot}/usr/share/open-vm-tools/GOSC/
67 67
 cp -r gosc-scripts %{buildroot}/usr/share/open-vm-tools/GOSC
68
-
69
-#stuff to enable vmtoolsd service
70
-cat >> %{buildroot}/lib/systemd/system/vmtoolsd.service <<-EOF
71
-[Unit]
72
-Description=Service for virtual machines hosted on VMware
73
-Documentation=http://open-vm-tools.sourceforge.net/about.php
74
-ConditionVirtualization=vmware
75
-After=cloud-final.service
76
-
77
-[Service]
78
-ExecStart=/usr/bin/vmtoolsd
79
-TimeoutStopSec=5
80
-
81
-[Install]
82
-WantedBy=multi-user.target
83
-EOF
84
-
68
+install -p -m 644 %{SOURCE2} %{buildroot}/lib/systemd/system
69
+install -p -m 644 %{SOURCE3} %{buildroot}/lib/systemd/system
85 70
 
86 71
 make DESTDIR=%{buildroot} install
87 72
 rm -f %{buildroot}/sbin/mount.vmhgfs
... ...
@@ -94,10 +81,12 @@ mv %{buildroot}%{_sysconfdir}/vmware-tools/vm-support %{buildroot}%{_bindir}
94 94
 
95 95
 %post
96 96
 /sbin/ldconfig
97
-/bin/systemctl enable vmtoolsd
97
+%systemd_post vgauthd.service
98
+%systemd_post vmtoolsd.service
98 99
 
99 100
 %preun
100
-/bin/systemctl disable vmtoolsd
101
+%systemd_preun vmtoolsd.service
102
+%systemd_preun vgauthd.service
101 103
 # Tell VMware that open-vm-tools is being uninstalled
102 104
 if [ "$1" = "0" -a                      \
103 105
      -e %{_bindir}/vmware-checkvm -a    \
... ...
@@ -108,6 +97,8 @@ fi
108 108
 
109 109
 %postun 
110 110
 /sbin/ldconfig
111
+%systemd_postun_with_restart vmtoolsd.service
112
+%systemd_postun_with_restart vgauthd.service
111 113
 
112 114
 %files 
113 115
 %defattr(-,root,root)
... ...
@@ -125,6 +116,8 @@ fi
125 125
 
126 126
 
127 127
 %changelog
128
+*	Wed Feb 03 2016 Anish Swaminathan <anishs@vmware.com> 10.0.5-3
129
+-	Add vgauthd service.
128 130
 *       Tue Feb 02 2016 Kumar Kaushik <kaushikk@vmware.com> 10.0.5-2
129 131
 -       Making interface file name according to convention.
130 132
 *	Tue Jan 26 2016 Anish Swaminathan <anishs@vmware.com> 10.0.5-1
131 133
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+[Unit]
1
+Description=VGAuth Service for open-vm-tools
2
+Documentation=http://github.com/vmware/open-vm-tools
3
+ConditionVirtualization=vmware
4
+PartOf=vmtoolsd.service
5
+
6
+[Service]
7
+ExecStart=/usr/bin/VGAuthService -s
8
+TimeoutStopSec=5
9
+
10
+[Install]
11
+RequiredBy=vmtoolsd.service
0 12
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+[Unit]
1
+Description=Service for virtual machines hosted on VMware
2
+Documentation=http://github.com/vmware/open-vm-tools
3
+ConditionVirtualization=vmware
4
+Requires=vgauthd.service
5
+After=cloud-final.service
6
+
7
+[Service]
8
+ExecStart=/usr/bin/vmtoolsd
9
+TimeoutStopSec=5
10
+
11
+[Install]
12
+WantedBy=multi-user.target
13
+Also=vgauthd.service