Project

General

Profile

[Solved] lighttpd fails to start

Added by saut74 almost 4 years ago

I am trying to start the lighttpd service in Centos8 and keep getting error of "exit-code". I looks like I am missing a .pid file, but not sure how to fix that. If more information is needed please let me know.

localhost.localdomain lighttpd[18285]: 2020-05-21 23:41:36: (server.c.424) unlink failed for: /run/lighttpd/lighttpd.pid 2 No such file or directory


Replies (4)

RE: lighttpd fails to start - Added by gstrauss almost 4 years ago

You've asked for assistance, and provided exactly one line from your logs.

The only help possible in this case is to inform you that that is a warning from lighttpd and not an error.

Please read the following: http://catb.org/~esr/faqs/smart-questions.html

RE: lighttpd fails to start - Added by saut74 almost 4 years ago

I am utilizing icy's post from 11 years ago, "How to get support - please read"

Operating System: CentOS Linux 8 (Core)
CPE OS Name: cpe:/o:centos:centos:8
Kernel: Linux 4.18.0-147.8.1.el8_1.x86_64
Architecture: x86-64

lighttpd/1.4.55 (ssl) - a light and fast webserver

Installed via dnf and no configuration after install.

This is what I get when I check the status of lighttpd service.

lighttpd.service - Lightning Fast Webserver With Light System Requirements
   Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2020-05-21 23:41:36 EDT; 14h ago
 Main PID: 18285 (code=exited, status=255)

May 21 23:41:36 localhost.localdomain systemd[1]: Started Lightning Fast Webserver With Light System Requirements.
May 21 23:41:36 localhost.localdomain lighttpd[18285]: 2020-05-21 23:41:36: (server.c.1233) opening pid-file failed: /run/lighttpd/lighttpd/lighttpd.pid No such file or directory
May 21 23:41:36 localhost.localdomain lighttpd[18285]: 2020-05-21 23:41:36: (server.c.424) unlink failed for: /run/lighttpd/lighttpd.pid 2 No such file or directory
May 21 23:41:36 localhost.localdomain systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
May 21 23:41:36 localhost.localdomain systemd[1]: lighttpd.service: Failed with result 'exit-code'.

To reproduce problem, I install lighttpd via dnf.

I hope this helps.

RE: lighttpd fails to start - Added by gstrauss almost 4 years ago

May 21 23:41:36 localhost.localdomain lighttpd18285: 2020-05-21 23:41:36: (server.c.1233) opening pid-file failed: /run/lighttpd/lighttpd/lighttpd.pid No such file or directory
May 21 23:41:36 localhost.localdomain lighttpd18285: 2020-05-21 23:41:36: (server.c.424) unlink failed for: /run/lighttpd/lighttpd.pid 2 No such file or directory

If lighttpd starts up and is configured to create a pid-file, but is unable to create a pid-file, then that is an error.
When lighttpd exits, if someone else has removed the pid-file, that is a warning, not an error, as I said above.

In your initial post, why did you post one line, instead of two lines?

You wrote:

I looks like I am missing a .pid file, but not sure how to fix that.

"No such file or directory" is a strong hint. Did you change something from the default CentOS configuration? Why do the two error messages have different paths?
"/run/lighttpd/lighttpd/lighttpd.pid"
"/run/lighttpd/lighttpd.pid"

Did you mistype the error messages by hand?

"No such file or directory" means exactly what it says. Literally. Troubleshooting "No such file or directory" is very, very straightforward. If the directory exists and the file does not exist, then "No such file or directory" refers to the file. If the directory does not exist, then "No such file or directory" refers to one or more directories in the path. Did you look to see what the problem is on your system?

If you modified lighttpd.conf to change the paths used by lighttpd, then you should modify your lighttpd systemd service startup script to create those paths (the directories).

BTW, you created an account and posted in the Forums. Before doing so, did you happen to try looking in the documentation at the configuration options and searching for "pid-file"? There is exactly one line that matches.

RE: lighttpd fails to start - Added by saut74 almost 4 years ago

I was able to get it working. Thanks for the help!

    (1-4/4)