Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disconnect between PIDFILE in lswsctrl and systemd service file #443

Open
nobod33 opened this issue Feb 20, 2025 · 0 comments
Open

disconnect between PIDFILE in lswsctrl and systemd service file #443

nobod33 opened this issue Feb 20, 2025 · 0 comments

Comments

@nobod33
Copy link

nobod33 commented Feb 20, 2025

Hello,

There seems to be "disconnect" between:
https://github.com/litespeedtech/openlitespeed/blob/master/dist/admin/misc/lshttpd.service.inand https://github.com/litespeedtech/openlitespeed/blob/master/dist/bin/lswsctrl
in relation to PIDFILE - service pointing to /var/run/openlitespeed.pid and lswsctl to /tmp/lshttpd/lshttpd.pid

As /tmp doesn't look like correct path to use for systemd service file(something what users might be willing to customize themselves) and thus mitigate it that way, lswsctl might need an update to reference same path?

With that mismatch , calling lswsctrl for restart fails to find correct service pid and basically no real restart happens.

# diff -u /usr/local/lsws/bin/lswsctrl /usr/local/lsws/bin/lswsctrl.1
--- /usr/local/lsws/bin/lswsctrl	2025-02-20 14:20:09.759479110 +0200
+++ /usr/local/lsws/bin/lswsctrl.1	2025-02-20 14:20:29.127591178 +0200
@@ -19,7 +19,7 @@
 
 # if the lsws_env is empty or not exist, still need to set the default values
 if [ "x$PIDFILE" = "x" ] ; then 
-    PIDFILE=/tmp/lshttpd/lshttpd.pid
+    PIDFILE=/var/run/openlitespeed.pid
     GRACEFUL_PIDFILE=/tmp/lshttpd/graceful.pid
 fi
 
# systemctl status openlitespeed
● litespeed.service - The OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/litespeed.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/litespeed.service.d
             └─override.conf
     Active: active (running) since Thu 2025-02-20 14:20:46 EET; 16min ago
    Process: 2037968 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
   Main PID: 2039199 (litespeed)
     CGroup: /system.slice/litespeed.service
             ├─2039199 "openlitespeed (lshttpd - main)"
             ├─2039200 "openlitespeed (lscgid)"
             ├─2039226 "openlitespeed (lshttpd - #01)"
             └─2039227 "openlitespeed (lshttpd - #02)"


# /usr/local/lsws/bin/lswsctrl restart
[OK] litespeed: pid=2040285.

# systemctl status openlitespeed
● litespeed.service - The OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/litespeed.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/litespeed.service.d
             └─override.conf
     Active: active (running) since Thu 2025-02-20 14:20:46 EET; 17min ago
    Process: 2037968 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
   Main PID: 2039199 (litespeed)
     CGroup: /system.slice/litespeed.service
             ├─2039199 "openlitespeed (lshttpd - main)"
             ├─2039200 "openlitespeed (lscgid)"
             ├─2039226 "openlitespeed (lshttpd - #01)"
             └─2039227 "openlitespeed (lshttpd - #02)"

# /usr/local/lsws/bin/lswsctrl.1 restart
[OK] Send SIGUSR1 to 2039199


 systemctl status openlitespeed
● litespeed.service - The OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/litespeed.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/litespeed.service.d
             └─override.conf
     Active: active (running) since Thu 2025-02-20 14:20:46 EET; 17min ago
    Process: 2037968 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
   Main PID: 2039199 (litespeed)
     CGroup: /system.slice/litespeed.service
             ├─2039199 "openlitespeed (lshttpd - main)"
             ├─2039200 "openlitespeed (lscgid)"
             ├─2039226 "openlitespeed (lshttpd - #01)"
             ├─2039227 "openlitespeed (lshttpd - #02)"
             ├─2040309 litespeed
             └─2040310 "openlitespeed (lscgid)"

# cat /usr/local/lsws/logs/lsrestart.log 
Thu Feb 20 02:37:37 PM EET 2025
restart, LSWS running: 0
Thu Feb 20 02:37:53 PM EET 2025
restart, LSWS running: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant