Failed to start Lighttpd Daemon on boot

16,745

Solution 1

Turns out this is a bug that's been around for years, if this issue is anything to go by. Several users in the comments of that bug claim that installing the gamin package solves this issue.

I haven't done any extensive testing, but it seems to be a solution. Running sudo apt install --reinstall lighttpd normally shows that it fails to start lighttpd. However, after installing gamin, the output looks like it normally would for any successful package installation. systemctl status also shows lighttpd as active and running now.

Note that the package libfam0 gets removed when installing gamin. I don't know what it's for, or what packages may depend on it, so keep that in mind, unless someone else can comment as to its usefulness and necessity.

Solution 2

I solved with this:

chown -R www-data:www-data /var/log/lighttpd/
Share:
16,745
Steve
Author by

Steve

Updated on September 18, 2022

Comments

  • Steve
    Steve 8 months

    Every time I turn on my laptop, I see this error message about Lighttpd appearing several times while booting process (also on systemctl --failed):

    Failed to start Lighttpd Daemon.
    See 'systemctl status lighttpd.service' for details.
    

    After logging in, I typed systemctl status lighttpd.service and got this output:

    ● lighttpd.service - Lighttpd Daemon
       Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Thu 2018-09-06 20:54:16 +05; 22min ago
      Process: 1170 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=127)
    Sen 06 20:54:16 ibrokhim-i systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
    Sen 06 20:54:16 ibrokhim-i systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
    Sen 06 20:54:16 ibrokhim-i systemd[1]: Stopped Lighttpd Daemon.
    Sen 06 20:54:16 ibrokhim-i systemd[1]: lighttpd.service: Start request repeated too quickly.
    Sen 06 20:54:16 ibrokhim-i systemd[1]: lighttpd.service: Failed with result 'exit-code'.
    Sen 06 20:54:16 ibrokhim-i systemd[1]: Failed to start Lighttpd Daemon.
    

    Also, this is the output from cat /etc/lighttpd/lighttpd.conf:

    server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
    )
    server.document-root        = "/var/www/html"
    server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
    server.errorlog             = "/var/log/lighttpd/error.log"
    server.pid-file             = "/var/run/lighttpd.pid"
    server.username             = "www-data"
    server.groupname            = "www-data"
    server.port                 = 80
    index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
    url.access-deny             = ( "~", ".inc" )
    static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
    compress.cache-dir          = "/var/cache/lighttpd/compress/"
    compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )
    # default listening port for IPv6 falls back to the IPv4 port
    ## Use ipv6 if available
    #include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
    include_shell "/usr/share/lighttpd/create-mime.assign.pl"
    include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
    

    How can I fix this problem?

    • Boris Hamanov
      Boris Hamanov over 4 years
      Edit your question and show me more /var/log/lighttpd/error.log. Report back to @heynnema. Do you use this webserver? Is apache2 installed also?
    • George Udosen
      George Udosen over 4 years
      @heynnema I thought bionic used gdm3?
    • Boris Hamanov
      Boris Hamanov over 4 years
      @GeorgeUdosen bionic does use gdm3... or lightdm. This OP is asking about lighttpd, which is a web server.
    • George Udosen
      George Udosen over 4 years
      What webserver is this @heynnema?
    • Boris Hamanov
      Boris Hamanov over 4 years
      @GeorgeUdosen look in Synaptic.
    • Steve
      Steve over 4 years
      @heynnema There's no error.log in /var/log/lighttpd/ - the folder is empty. And also, I don't know what the webserver is in the first place. I think apache2 is not installed.
  • Tran Situ
    Tran Situ over 3 years
    Worked for me. Might also be helpful to chmod 755 /var/log/lighttpd in conjunction with the above command
  • ldias
    ldias about 3 years
    This worked for me. Thanks
  • zrajm
    zrajm over 2 years
    Worked on Lubuntu 20.04 (Fecal Fossa).