From b9197b62698790c8e3d5339ff13236a91c3db68e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 27 Jun 2019 00:57:28 +0200 Subject: [PATCH] Fix 'unable to write random state in SSL init (same patch as for yunohost-admin) --- data/hooks/conf_regen/02-ssl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/hooks/conf_regen/02-ssl b/data/hooks/conf_regen/02-ssl index 963ec12ef..f74da20af 100755 --- a/data/hooks/conf_regen/02-ssl +++ b/data/hooks/conf_regen/02-ssl @@ -23,8 +23,10 @@ do_init_regen() { mkdir -p "${ssl_dir}/"{ca,certs,crl,newcerts} # initialize some files + # N.B. : the weird RANDFILE thing comes from: + # https://stackoverflow.com/questions/94445/using-openssl-what-does-unable-to-write-random-state-mean [[ -f "${ssl_dir}/serial" ]] \ - || openssl rand -hex 19 > "${ssl_dir}/serial" + || RANDFILE=.rnd openssl rand -hex 19 > "${ssl_dir}/serial" [[ -f "${ssl_dir}/index.txt" ]] \ || touch "${ssl_dir}/index.txt"