Nginx Systemd is failing to start on reboot
|Reported by:||Owned by:|
|Keywords:||systemd service restart reboot||Cc:|
|uname -a:||Linux web00 4.17.17-x86_64-linode116 #1 SMP PREEMPT Mon Aug 20 16:07:40 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux|
nginx version: nginx/1.15.3
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)
built with OpenSSL 1.1.1 11 Sep 2018
TLS SNI support enabled
configure arguments: --with-openssl=/tmp/openssl-1.1.1/ --add-module=/tmp/incubator-pagespeed-ngx-184.108.40.206-beta --add-module=/tmp/headers-more-nginx-module --add-module=/tmp/ngx_brotli --prefix=/opt/nginx --with-http_ssl_module --with-http_slice_module --with-http_gzip_static_module --with-cc-opt=-Wno-error --with-http_sub_module --with-http_stub_status_module --with-http_flv_module --with-http_xslt_module --with-http_image_filter_module --with-mail --with-mail_ssl_module --with-http_mp4_module --with-http_v2_module
I recently updated my linode VM (UB16.04.5, 4.17.17-x86_64-linode116) to use nginx/1.15.3, openssl/1.1.1, and my systemd config started to not start on reboot. Systemd config was from the nginx.com website example.
It was timing out on the prestart. I removed the prestart, and then it started timing out on the start.
I adjusting the targets to make it start later in the process, still timed out. Then I added bin/sleep 15 to the prestart. Still timed out.
Sleep 30 also timed out, but allowed me to check the status and it looks like it times out after about 2 minutes of trying to start.
When I manually run it by the cmd line it starts and starts in about 30s. Which seems long, but well within the 2 minute time out.
The previous version of nginx/openssl that was installed was nginx/1.13.12 openssl/1.1.0h This combination restarted nginx on reboot correctly.