Articles in this section

Nginx/Apache down after Plesk reboot: service start operation timed out. Terminating

Plesk for Linux kb: technical ABT: Group A FR:PPM-2856

Applicable to:

  • Plesk for Linux
  • Nginx and Apache don't start automatically after a server reboot

  • The journal shows timeout errors during startup:

    # journalctl -u apache2 -u httpd -u nginx -b
    systemd[1]: httpd.service start operation timed out. Terminating.
    systemd[1]: nginx.service start-pre operation timed out. Terminating.

  • The services can be started manually without issues

Cause

The timeout value of the services is too low, and they don't have enough time to start.

Resolution

Increase the Apache and nginx service timeout.

  1. Log in over SSH

  2. Run this command to backup the startup scripts and update the timeout value:

    # for s in /usr/lib/systemd/system/{nginx,httpd,apache2}.service; do [ -f "$s" ] && cp -au "$s"{,.bak} && sed -i '/^[Service]/,/^[/{/^TimeoutStartSec=/{h;s/=.*/=600/};t;s/([Service])/\1\nTimeoutStartSec=600/}' $s; done

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.