On Wed, May 27, 2026 at 01:03:42AM -0400, Glenn Strauss wrote: > > Lighttpd seemed to detect the changed time condition and attempted to > > restart itself to handle it, but it just stopped instead of restarting. > > This can happen for a number of reasons, including using chroot, > or using relative paths to important files which are not valid > after lighttpd daemonizes and chdirs to '/'. > > Your description of lighttpd stopping instead of restarting > differs from the title of this bug: > "lighttpd crashes instead of restarting on time change"
> If lighttpd is not crashing, then the title is misleading. Perhaps "crash" was not the best word to use. I meant to say that lighttpd says (in its logs) that it is going to restart, and then it doesn't restart but instead the lighttpd processes terminates completely without making any further records in the logs which might help sysadmin find out what happened. So feel free to retitle if there is more suitable wording (perhaps just "unexpectedly terminates" instead of "crashes"?) > If lighttpd is crashing, please provide more details, > such as a gdb backtrace on the core file. gdb just says that: [Inferior 1 (process 12902) exited with code 0377] (so there is no backtrace at that point) > If lighttpd is not crashing, but is instead exiting instead of > restarting, then check your lighttpd error log or journalctl to > see why lighttpd was unable to restart. There is no journalctl (as indicated in the original report, it is sysvinit system, not a systemd one) All logs I've seen are those 5 lines included in original report (which got logged in /var/log/lighttpd/error.log) and which do not indicate why that attempt at restart failed. > If those do not provide enough details, then you can strace -p the > lighttpd pid while you send a SIGUSR1 to the lighttpd process to trigger > a graceful restart. Look at the system calls which fail. Yes, sending it USR1 manually terminates lighttpd too. strace(1) reveals it is due to EPERM opening private key file for https certificate. I guess originally it worked because lighttpd was still running as a root at the time of system startup. So some suggestions: - when lighttpd decides to terminates due to some error, it should log an error in its /var/log/lighttpd/error.log log. Currently it seems it attempts to write the error only to STDERR (which won't be seen by sysadmin, as the restart was not invoked manually from shell but automatically): 1513 20:56:17 openat(AT_FDCWD, "/var/lib/acme/live/REDACTED/privkey", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_CLOEXEC) = -1 EACCES (Permission denied) 1513 20:56:17 write(2, "2026-06-06 20:56:15: (fdevent.c.946) fdevent_load_file() /var/lib/acme/live/REDACTED/privkey: Permission denied\n", 127) = 127 1513 20:56:17 write(2, "2026-06-06 20:56:15: (server.c.1696) Initialization of plugins failed. Going down.\n", 83) = 83 (additionally, FD 2 seems to have been /dev/null'ed at the time, so the error message won't even hit the boot console terminal): # lsof -p 13002 | grep -w 2u lighttpd 13002 www-data 2u CHR 1,3 0t0 4 /dev/null - change of time should not cause the lighttpd to attempt to restart, especially when it (could) know that restart is not going to be successful. Is there a reason that time-change is a critical error requiring server restart? I'd prefer if lighttpd just logged an warning in such situation and continue to function (perhaps make it an option if there are very good reasons for restart, but it is not absolutely required?) I do not want lighttpd attempting to restart auto-magically. (and especially if there is any chance that restart might not work, and lighttpd might terminate instead). IOW, if I want it restarted, I want to do it manually (when I'm ready and logged in to the server). Some other servers do safety check first to verify if they are very certain that subsequent restart is going to successful, and attempt to restart only in such case. That could be an alternative. Thanks for your consideration. Cheers, Matija (P.S. While this specific problem is just one of several that might lead to lighttpd terminating in the middle of the night or when sysadmin is far away; I'd like to note that immediate "fix" by tweaking private key file permissions is not easy in this specific case either, as acmetool(8) has certain ideas what permissions should be, and "helpfully autocorrects" them - which I find as problematic as deamons which "helpfully (attempt) autorestarts") -- Opinions above are GNU-copylefted.

