Strange issue with lshttpd service and lswsctrl restart

#1
I did a bit of digging to come up with the source of this problem. It arises only when I run a bash alias for the lswsctrl restart command. Is this a permissions issue?

Maybe this is specific to CentOS 8 or even SELinux, though I set SELinux to permissive mode and the same error occurs.

My alias is inside a file in /etc/profile.d:

alias olsrestart='/usr/local/lsws/bin/lswsctrl restart'

I run this alias often when changing server settings and I've had no problems with it on CentOS 7, but on CentOS 8 it reports a failure:

● lshttpd.service - OpenLiteSpeed HTTP Server
Loaded: loaded (/usr/lib/systemd/system/lshttpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2020-10-12 12:05:55 CEST; 12s ago
Process: 823 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
Main PID: 1079 (code=exited, status=255)
CGroup: /system.slice/lshttpd.service
├─1248 openlitespeed (lshttpd - main)
├─1254 openlitespeed (lscgid)
├─1256 openlitespeed (lshttpd - #01)
├─1257 lsphp
└─1258 lsphp

Oct 12 11:53:18 biz-ff systemd[1]: Starting OpenLiteSpeed HTTP Server...
Oct 12 11:53:19 biz-ff lswsctrl[823]: [OK] litespeed: pid=885.
Oct 12 11:53:21 biz-ff systemd[1]: Started OpenLiteSpeed HTTP Server.
Oct 12 12:05:55 biz-ff systemd[1]: lshttpd.service: Main process exited, code=exited, status=255/n/a
Oct 12 12:05:55 biz-ff systemd[1]: lshttpd.service: Failed with result 'exit-code'.


BUT! The service actually appears to be running correctly. There are no errors in the log, and sites are served just fine. It's simply being reported as failed.

The restart command works fine when not used through an alias. The Graceful Restart button in WebAdmin works fine, and the Start Service button in Cockpit all work fine - the service reports as Active. So the only problem seems to be the use of the bash alias.
 
#2
I should add once this failure arises, I can only restart the service successfully through Cockpit, which appears to immediately terminate the old process - no graceful restart. The error remains if I use the other methods of graceful restart, or even if I reboot the VPS.
 
Top