Services timed out at boot but could start manually what could be the problem?

Jos*_*osh 2 systemd php7

I've installed apche2 and php7.1-fpm recently and added them to boot with

systemctl enable apache2
systemctl enable php7.1-fpm
Run Code Online (Sandbox Code Playgroud)

After rebooting the system systemctl status shows the following:

sudo systemctl  status apache2.service php7.1-fpm.service

? apache2.service - The Apache HTTP Server
 Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor 
preset: enabled)
 Active: failed (Result: timeout) since Mon 2017-12-25 18:53:43 CET; 
  10min ago
  Process: 468 ExecStart=/usr/sbin/apachectl start (code=killed, 
signal=TERM)

Dez 25 18:53:33 drupal-PC systemd[1]: Starting The Apache HTTP 
Server...
Dez 25 18:53:43 drupal-PC apachectl[468]: AH00558: apache2: Could not 
reliably determine the server's fully qualified do
Dez 25 18:53:43 drupal-PC systemd[1]: apache2.service: Start operation 
timed out. Terminating.
Dez 25 18:53:43 drupal-PC systemd[1]: Failed to start The Apache HTTP 
Server.
Dez 25 18:53:43 drupal-PC systemd[1]: apache2.service: Unit entered 
failed state.
Dez 25 18:53:43 drupal-PC systemd[1]: apache2.service: Failed with 
result 'timeout'.

? php7.1-fpm.service - The PHP 7.1 FastCGI Process Manager
 Loaded: loaded (/lib/systemd/system/php7.1-fpm.service; enabled; 
 vendor preset: enabled)
  Active: failed (Result: timeout) since Mon 2017-12-25 18:53:43 CET; 
  10min ago
    Docs: man:php-fpm7.1(8)
   Process: 463 ExecStart=/usr/sbin/php-fpm7.1 --nodaemonize --fpm-
 config /etc/php/7.1/fpm/php-fpm.conf (code=killed, sig
 Main PID: 463 (code=killed, signal=TERM)

 Dez 25 18:53:33 drupal-PC systemd[1]: Starting The PHP 7.1 FastCGI 
 Process Manager...
 Dez 25 18:53:43 drupal-PC systemd[1]: php7.1-fpm.service: Start 
 operation timed out. Terminating.
Dez 25 18:53:43 drupal-PC systemd[1]: Failed to start The PHP 7.1 
FastCGI Process Manager.
Dez 25 18:53:43 drupal-PC systemd[1]: php7.1-fpm.service: Unit entered 
failed state.
Dez 25 18:53:43 drupal-PC systemd[1]: php7.1-fpm.service: Failed with 
result 'timeout'.
Run Code Online (Sandbox Code Playgroud)

If I start the services by hand everything works fine. Where is the issue?

小智 7

看起来这个问题已经很老了,但是对于像我这样遇到同样问题的人来说 - 有一个

DefaultTimeoutStartSec
DefaultTimeoutStopSec
Run Code Online (Sandbox Code Playgroud)

选项负责表示在全球范围内/etc/systemd/system.conf

或者

TimeoutStartSec
TimeoutStopSec
Run Code Online (Sandbox Code Playgroud)

.service链接的单个文件中/etc/systemd/system,在我的系统中默认设置为15s. 更改以60s解决问题