PDA

View Full Version : lsws stopped suddently ?


vivek
04-22-2008, 11:47 PM
Hello
I just found that the lsws stopped

I restarted litespeed, and is running ok now. It is the second time lsws is quitting like this. Clients are complaining about this.

I checked the log and become mad.
I backed up the old error_log file to error_log1

george can you take a look at this ? I hope you have the server login.

Vivek

vivek
04-23-2008, 03:43 AM
Hello

I am looking for a modification of the restart cron script.

Origianl : http://litespeedtech.com/support/forum/showthread.php?p=9185#post9185


I may require both, Apache and Litespeed. So I want to include codes for apache restart.

I want something like this.

Cron job : 1 or 5 minutes interval.

start
check whether apache wrapper is used or not.
If wrapper scritpt is using
{
. check whether lshttpd is running or not.
. if not running , restart it and send a mail to the root with date and time.
}

else
. check whether apache is running or not
. if it is not running, restart httpd. , send a mail to root with date and time.
stop



I am not good in bash scripting, can anyone help me for this code ?

vivek
04-23-2008, 03:45 AM
BTW, why dont litespeed itself install such a cron ? So that litespeed will never exit.

There was 1.5hrs of downtime today because of this.

hadyabed
04-23-2008, 03:48 AM
What version of LSWS are you running? I believe there was just a bug fix for lshttpd stopping randomly in version 3.3.10. If you don't have this version, you may want to upgrade.
-Hady Abed

Dani
04-23-2008, 09:56 AM
I've seen similar things on our server, the lshttpd process is running, and some lsphp but I can't access the webpage, a restart helped it for about 10minutes. But after that it killed connections again, finally a reboot of the server seems to have done it. (this with the latest .10 version).

No weird activities in the log files can be seen. I'm still monitoring this and can hopefully try to locate something useful if it continiues.

mistwang
04-23-2008, 10:27 AM
I've seen similar things on our server, the lshttpd process is running, and some lsphp but I can't access the webpage, a restart helped it for about 10minutes. But after that it killed connections again, finally a reboot of the server seems to have done it. (this with the latest .10 version).

No weird activities in the log files can be seen. I'm still monitoring this and can hopefully try to locate something useful if it continiues.
If that is happen, please use command

kill -USR2 <pid_of_a_child_lshttpd>

to turn on debug logging and let it run for a while then send the log file to us.
Run to kill command again to turn off the debug logging.

Make sure to set server "Log Level" to "DEBUG" and server "Debug Level" to "NONE".

Dani
04-23-2008, 12:00 PM
If that is happen, please use command

kill -USR2 <pid_of_a_child_lshttpd>

to turn on debug logging and let it run for a while then send the log file to us.
Run to kill command again to turn off the debug logging.

Make sure to set server "Log Level" to "DEBUG" and server "Debug Level" to "NONE".

So does the kill command toggle the debug or do I have to have it enabled before running it?

mistwang
04-23-2008, 12:17 PM
debug log controled by both "Log Level" and "Debug Level", "kill -USR2" toggles "Debug Level".

mistwang
04-23-2008, 05:12 PM
Hello
I just found that the lsws stopped

I restarted litespeed, and is running ok now. It is the second time lsws is quitting like this. Clients are complaining about this.

I checked the log and become mad.
I backed up the old error_log file to error_log1

george can you take a look at this ? I hope you have the server login.

It is caused by one your cron job that remove everything under /tmp on the 45 minutes every hour. when /tmp/lshttpd directory is removed, LSWS will have to restart itself, normally it is not a problem, the server will start fine. But for whatever reason, maybe the LSWS was killed in the middle of the restart, the new process does not get started as planed.
You should avoid removing /tmp/lshttpd directory hourly.

vivek
04-23-2008, 09:10 PM
It is caused by one your cron job that remove everything under /tmp on the 45 minutes every hour. when /tmp/lshttpd directory is removed, LSWS will have to restart itself, normally it is not a problem, the server will start fine. But for whatever reason, maybe the LSWS was killed in the middle of the restart, the new process does not get started as planed.
You should avoid removing /tmp/lshttpd directory hourly.

Ok, I removed the cron. I added the cron because I found that some users are using c99,snipper shells and that is causing a file /tmp/back which is actually an executable file starting with #! , plus the litespeed didnt work with modsec rules for preventing shell file executions ( c99 etc ) through 80 port

Vivek

mistwang
04-23-2008, 09:13 PM
You can remove files under /tmp, just do not touch /tmp/lshttpd.

vivek
04-23-2008, 09:16 PM
You can remove files under /tmp, just do not touch /tmp/lshttpd.

I cant find such a code for removing all files except /tmp/lshttpd.

Do you know it?

Vivek

mistwang
04-24-2008, 05:07 PM
I am not a shell expert. Maybe you can use 'sed' to remove entries contains /tmp/lshttpd

vivek
04-24-2008, 06:24 PM
nevermind.