litespeed service inactive, but web service is still running

#1
I see this issue many times recently.
The OLS service has been running for a while, no change in its config. Suddenly, got a warning: litespeed.service is not active, cannot reload.
systemctl status confirm its status is inactive.

Code:
# systemctl status lsws
× litespeed.service - The OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/litespeed.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Tue 2024-05-14 02:52:09 +07; 3s ago
   Duration: 2.528s
    Process: 1277417 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
   Main PID: 1277434 (code=exited, status=1/FAILURE)
     CGroup: /system.slice/litespeed.service
             ├─1274099 "openlitespeed (lshttpd - main)"
             ├─1274100 "openlitespeed (lscgid)"
             ├─1274466 "openlitespeed (lshttpd - #01)"
             └─1274467 "openlitespeed (lshttpd - #02)"

May 14 02:52:04 server-name systemd[1]: Starting The OpenLiteSpeed HTTP Server...
May 14 02:52:05 server-name lswsctrl[1277417]: [OK] litespeed: pid=1277434.
May 14 02:52:07 server-name systemd[1]: Started The OpenLiteSpeed HTTP Server.
May 14 02:52:09 server-name systemd[1]: litespeed.service: Main process exited, code=exited, status=1/FAILURE
May 14 02:52:09 server-name systemd[1]: litespeed.service: Failed with result 'exit-code'.
May 14 02:52:09 server-name systemd[1]: litespeed.service: Unit process 1274099 (litespeed) remains running after unit stopped.
May 14 02:52:09 server-name systemd[1]: litespeed.service: Unit process 1274100 (litespeed) remains running after unit stopped.
May 14 02:52:09 server-name systemd[1]: litespeed.service: Unit process 1274466 (litespeed) remains running after unit stopped.
May 14 02:52:09 server-name systemd[1]: litespeed.service: Unit process 1274467 (litespeed) remains running after unit stopped.
May 14 02:52:09 server-name systemd[1]: litespeed.service: Unit process 1277438 (litespeed) remains running after unit stopped.
However, as shown in the log, the web service is still running. I can access websites without problem. But restarting lsws doesn't bring the service active. In the /var/log/httpd/error_log, there are some logs
Code:
2024-05-14 02:45:32.091409 [ERROR] [1276485] HttpListener::start(): Can't listen at address adminListener: Address already in use!
2024-05-14 02:45:32.091482 [ERROR] [1276485] HttpServer::addListener(adminListener) failed to create new listener
2024-05-14 02:45:32.091487 [ERROR] [1276485] [config:admin:listener:adminListener] failed to start listener on address *:7080!
2024-05-14 02:45:32.091493 [ERROR] [1276485] [config:admin:listener] No listener is available for admin virtual host!
2024-05-14 02:45:32.112563 [ERROR] [1276485] Fatal error in configuration, exit!
I searched, found an old guide for the same issue, but it's not in my case. If I killed all OLS processes, then I can restart the service, again no change in its configuration.

I wonder what the reason is, and how to prevent it keep happening?
Thanks.
 

Cold-Egg

Administrator
#2
Try full stop, then start OLS, and see if it helps.
Code:
/usr/local/lsws/bin/lswsctrl stop
systemctl restart lsws
 
Last edited:

Cold-Egg

Administrator
#4
Please check lsrestat.log, to get some idea of what happened. A graceful restart must be completed before issuing another one.
1. Avoid using systemctl stop lsws or systemctl start lsws, use Always use "systemctl restart lsws" only, otherwise it may break the graceful restart.
2. Avoid multiple restarts in a short time, it could also cause the above issue.
 
#5
There is no lsrestat.log. I tried to search in other log files, in /var/log/messages, there are 2 lines happening at the same time I received notification
May 13 21:45:01 trondheim lswsctrl[1049171]: [OK] Send SIGUSR1 to 1047094
May 13 21:51:01 trondheim lswsctrl[1050184]: [OK] Send SIGUSR1 to 1049218

However, after that, there are also multiple lines like that, and I don't have any other notification. And it's happening automatically without me doing any restarting.
 
#6
Now it happens again. But full stop didn't help.

Code:
[root@servername ~]# /usr/local/lsws/bin/lswsctrl stop
[ERROR] litespeed is not running.

[root@servername ~]# systemctl stop lsws
[root@servername ~]# systemctl status lsws
× litespeed.service - The OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/litespeed.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2024-05-25 23:29:30 +07; 9s ago
   Duration: 2.442s
    Process: 1236734 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
   Main PID: 1236750 (code=exited, status=1/FAILURE)
     CGroup: /system.slice/litespeed.service
             ├─1234430 "openlitespeed (lshttpd - main)"
             ├─1234431 "openlitespeed (lscgid)"
             └─1234456 "openlitespeed (lshttpd - #02)"

May 25 23:29:25 servername systemd[1]: Starting The OpenLiteSpeed HTTP Server...
May 25 23:29:25 servername lswsctrl[1236734]: [OK] litespeed: pid=1236750.
May 25 23:29:27 servername systemd[1]: Started The OpenLiteSpeed HTTP Server.
May 25 23:29:30 servername systemd[1]: litespeed.service: Main process exited, code=exited, status=1/FAILURE
May 25 23:29:30 servername systemd[1]: litespeed.service: Failed with result 'exit-code'.
May 25 23:29:30 servername systemd[1]: litespeed.service: Unit process 1234430 (litespeed) remains running a>
May 25 23:29:30 servername systemd[1]: litespeed.service: Unit process 1234431 (litespeed) remains running a>
May 25 23:29:30 servername systemd[1]: litespeed.service: Unit process 1234456 (litespeed) remains running a>
May 25 23:29:30 servername systemd[1]: litespeed.service: Unit process 1236754 (litespeed) remains running a>
lines 1-20/20 (END)
I needed to "kill -9" all those processes then I could restart lsws. No helpful log in stderr or error_log.
 
#8
Here is log with timestamps around the time I checked
Code:
Sat May 25 23:27:01 +07 2024
restart, LSWS running: 1
Sat May 25 23:28:58 +07 2024
stop, LSWS running: 1
Sat May 25 23:29:25 +07 2024
start, LSWS running: 0
Sat May 25 23:31:01 +07 2024
start, LSWS running: 0
Sat May 25 23:32:23 +07 2024
start, LSWS running: 0
Sat May 25 23:34:54 +07 2024
stop, LSWS running: 0
Sat May 25 23:36:01 +07 2024
restart, LSWS running: 1
 
Top