Change the timeout limit

To prevent a malfunctioning service from freezing the system, you can specify a timeout value per service. Otherwise, the default value for timeout is 90 seconds for normal services and 300 seconds for SysV-compatible services.

Before you begin

  • You have administrative privileges.

Procedure

  1. Edit the httpd unit file:
    # systemctl edit httpd
  2. Specify the TimeoutStartSec value in the [Service] section:
    ...
    [Service]
    ...
    PrivateTmp=true
    TimeoutStartSec=10
    
    [Install]
    WantedBy=multi-user.target
    ...
  3. Reload the systemd daemon:
    # systemctl daemon-reload

Results

  • Verify the new timeout value:
    # systemctl show httpd -p TimeoutStartUSec
    Note

    To change the timeout limit globally, input the DefaultTimeoutStartSec in the /etc/systemd/system.conf file.