Has anyone here used vhttpd on Redhat 3.0? I am having a weird issue where if I start vhttpd and let it run, over time the daemons build up until it hits the MaxClients setting. I then have to restart vhttpd and wait a few days to do it again.. ;>(
vhttpd
vhttpd
Here it is. You'll have to adapt the ps usage and import for Linux.
#!/usr/local/morph3/bin/texis -r
<script language=vortex>
<a name=main>
<if $maxage eq ''><$maxage=30></if>
<write append /usr/tmp/watchvhttpd.log>
<exec "/usr/bin/ps" "-e" "-o" "pcpu,pid,ppid,stime,time,vsz,rss,args"></exec>
<rex ".*>>/vhttpd=.*" $ret>
<rex ".*\digit+ \digit\digit:\digit\digit:\digit\digit =.*" $ret>
<sum "%s
" "" $ret><substr $ret 1 -1><$ps=$ret>
<timport "col
keepfirst
datefmt HH:MM:SS
field Pid int 6-10
field Ppid int 12-16
field Stime date 18-25
field Cmd varchar 49- ''
" $ps>
<if $Ppid ne 1>
<$age=( (convert( 'now' , 'date' )-$Stime)/60 )>
<if $age gt $maxage>
<fmt "%at " "%Y-%m-%d %H:%M:%S" "now">BAD $age $Pid|$Ppid|$Stime|$Cmd
<kill $Pid>
<else>
<if $verbose gt 0>
GOOD $age $Pid|$Ppid|$Stime|$Cmd
</if>
</if>
</if>
</timport>
<if $verbose gt 0>
$loop records
</if>
</write>
<!--
%CPU PID PPID STIME TIME VSZ RSS COMMAND
0.0 9223 9189 17:15:56 0:00 8196 1116 /usr/local/morph3/bin/vhttpd -d /usr2/pub/httpd
0.0 9525 9189 17:23:25 0:00 7852 1100 /usr/local/morph3/bin/vhttpd -d /usr2/pub/httpd
1234567890123456789012345678901234567890123456789
1 2 3 4
-->
</a>
</script>
#!/usr/local/morph3/bin/texis -r
<script language=vortex>
<a name=main>
<if $maxage eq ''><$maxage=30></if>
<write append /usr/tmp/watchvhttpd.log>
<exec "/usr/bin/ps" "-e" "-o" "pcpu,pid,ppid,stime,time,vsz,rss,args"></exec>
<rex ".*>>/vhttpd=.*" $ret>
<rex ".*\digit+ \digit\digit:\digit\digit:\digit\digit =.*" $ret>
<sum "%s
" "" $ret><substr $ret 1 -1><$ps=$ret>
<timport "col
keepfirst
datefmt HH:MM:SS
field Pid int 6-10
field Ppid int 12-16
field Stime date 18-25
field Cmd varchar 49- ''
" $ps>
<if $Ppid ne 1>
<$age=( (convert( 'now' , 'date' )-$Stime)/60 )>
<if $age gt $maxage>
<fmt "%at " "%Y-%m-%d %H:%M:%S" "now">BAD $age $Pid|$Ppid|$Stime|$Cmd
<kill $Pid>
<else>
<if $verbose gt 0>
GOOD $age $Pid|$Ppid|$Stime|$Cmd
</if>
</if>
</if>
</timport>
<if $verbose gt 0>
$loop records
</if>
</write>
<!--
%CPU PID PPID STIME TIME VSZ RSS COMMAND
0.0 9223 9189 17:15:56 0:00 8196 1116 /usr/local/morph3/bin/vhttpd -d /usr2/pub/httpd
0.0 9525 9189 17:23:25 0:00 7852 1100 /usr/local/morph3/bin/vhttpd -d /usr2/pub/httpd
1234567890123456789012345678901234567890123456789
1 2 3 4
-->
</a>
</script>