Browse code

Edit post scripts for WALinuxAgent

Change-Id: I9c9f4ae1bbd72ca364423eef839c588ab717ba20
Reviewed-on: http://photon-jenkins.eng.vmware.com/852
Tested-by: jenkins-photon <wangnan2015@hotmail.com>
Reviewed-by: Sharath George
(cherry picked from commit c417d8507aee60a28e3685ed2e3ded6cd4426e82)
Reviewed-on: http://photon-jenkins.eng.vmware.com/863
Reviewed-by: suezzelur <anishs@vmware.com>

suezzelur authored on 2016/05/11 08:12:54
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 Name:           WALinuxAgent
2 2
 Summary:        The Windows Azure Linux Agent
3 3
 Version:        2.0.18
4
-Release:        1%{?dist}
4
+Release:        2%{?dist}
5 5
 License:        Apache License Version 2.0
6 6
 Group:          System/Daemons
7 7
 Url:            http://go.microsoft.com/fwlink/?LinkId=250998
... ...
@@ -14,6 +14,7 @@ Distribution:	Photon
14 14
 BuildRequires:  python2
15 15
 BuildRequires:  python2-libs
16 16
 BuildRequires:  python-setuptools
17
+BuildRequires:  systemd
17 18
 Requires:       python2
18 19
 Requires:       python2-libs
19 20
 Requires:       python-pyasn1
... ...
@@ -24,6 +25,7 @@ Requires:       sed
24 24
 Requires:       grep
25 25
 Requires:       sudo
26 26
 Requires:       iptables
27
+Requires:       systemd
27 28
 
28 29
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
29 30
 BuildArch:      noarch
... ...
@@ -42,7 +44,7 @@ find . -type f -exec chmod 0644 {} +
42 42
 %pre -p /bin/sh
43 43
 
44 44
 %build
45
-#%{__python} setup.py build
45
+%{__python} setup.py build
46 46
 
47 47
 %install
48 48
 %{__python} setup.py install --prefix=%{_prefix} --lnx-distro='photon' --init-system='systemd' --root=%{buildroot}
... ...
@@ -51,23 +53,17 @@ mkdir -p -m 0700 %{buildroot}/%{_sharedstatedir}/waagent
51 51
 touch %{buildroot}/%{_localstatedir}/log/waagent.log
52 52
 
53 53
 %post
54
-/sbin/chkconfig --add waagent
54
+%systemd_post waagent.service
55 55
 
56
-%preun -p /bin/sh
57
-if [ $1 = 0 ]; then
58
-	/sbin/service waagent stop >/dev/null 2>&1
59
-	/sbin/chkconfig --del waagent
60
-fi
56
+%preun
57
+%systemd_preun waagent.service
61 58
 
62
-%postun -p /bin/sh
63
-if [ "$1" -ge "1" ]; then
64
-	/sbin/service waagent restart >/dev/null 2>&1 || :
65
-fi
59
+%postun
60
+%systemd_postun_with_restart waagent.service
66 61
 
67 62
 
68 63
 %files
69 64
 /usr/lib/systemd/system/*
70
-#%attr(0755,root,root) %{_initddir}/waagent
71 65
 %attr(0755,root,root) %{_sysconfdir}/udev/rules.d/99-azure-product-uuid.rules
72 66
 %defattr(0644,root,root,0755)
73 67
 %doc Changelog LICENSE-2.0.txt NOTICE README
... ...
@@ -79,6 +75,8 @@ fi
79 79
 
80 80
 
81 81
 %changelog
82
+* Tue May 10 2016 Anish Swaminathan <anishs@vmware.com> 2.0.18-2
83
+- Edit post scripts
82 84
 * Thu Apr 28 2016 Anish Swaminathan <anishs@vmware.com> 2.0.18-1
83 85
 - Update to 2.0.18
84 86
 * Thu Jan 28 2016 Anish Swaminathan <anishs@vmware.com> 2.0.14-3