Browse code

haveged, rngd: Start them before cloud-init-local.service

Recently it was observed that booting slows down considerably when
sufficient entropy is not available. This is particularly noticeable
on VMs with a lot of memory - eg: booting slows down by 5 minutes on
an 8GB VM. (See https://github.com/vmware/photon/issues/774).

Further analysis showed that cloud-init-local.service takes most of
that additional time. Now, installing tools like haveged and rngd
(rng-tools) can help alleviate the problem (they feed additional
entropy to the kernel); however, in this particular case, they didn't
help because systemd starts these services after cloud-init-local.service.

So, fix the ordering to make sure that haveged and rngd are run before
cloud-init-local.service.

Change-Id: I0660317387c1ad59fca4d3fee96c5aefcdfa8c9d
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5151
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Srivatsa S. Bhat authored on 2018/05/11 07:58:34
Showing 4 changed files
... ...
@@ -1,6 +1,8 @@
1 1
 [Unit]
2 2
 Description=Entropy Daemon based on the HAVEGE algorithm
3 3
 Documentation=man:haveged(8) http://www.issihosts.com/haveged/
4
+DefaultDependencies=no
5
+Before=cloud-init-local.service
4 6
 
5 7
 [Service]
6 8
 Type=simple
... ...
@@ -3,7 +3,7 @@
3 3
 Summary:        A Linux entropy source using the HAVEGE algorithm
4 4
 Name:           haveged
5 5
 Version:        1.9.1
6
-Release:        3%{?dist}
6
+Release:        4%{?dist}
7 7
 License:        GPLv3+
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Discus
... ...
@@ -106,8 +106,10 @@ rm -rf %{buildroot}
106 106
 
107 107
 
108 108
 %changelog
109
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.9.1-3
110
--	GA - Bump release of all rpms
109
+* Thu May 10 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 1.9.1-4
110
+- Start haveged before cloud-init-local.service to speed up booting.
111
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.9.1-3
112
+- GA - Bump release of all rpms
111 113
 * Wed Dec 09 2015 Anish Swaminathan <anishs@vmware.com> 1.9.1-2
112 114
 - Add systemd requirement.
113 115
 * Sun Jan 13 2013 Jirka Hladky <hladky.jiri@gmail.com> - 1.7h-0
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	RNG deamon and tools
2 2
 Name:		rng-tools
3 3
 Version:	5
4
-Release:	1%{?dist}
4
+Release:	2%{?dist}
5 5
 License:	GPLv2
6 6
 URL:		https://sourceforge.net/projects/gkernel/
7 7
 Group:          System Environment/Base
... ...
@@ -50,5 +50,7 @@ make  %{?_smp_mflags} check
50 50
 %{_mandir}/*
51 51
 
52 52
 %changelog
53
+*       Thu May 10 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 5-2
54
+-       Start rngd before cloud-init-local.service to speed up booting.
53 55
 *       Wed Oct 26 2016 Alexey Makhalov <amakhalov@vmware.com> 5-1
54 56
 -	Initial version.
... ...
@@ -1,6 +1,8 @@
1 1
 [Unit]
2 2
 Description=Hardware RNG entropy gatherer daemon
3 3
 Documentation=man:rngd(8)
4
+DefaultDependencies=no
5
+Before=cloud-init-local.service
4 6
 
5 7
 [Service]
6 8
 PIDFile=/var/run/rngd.pid