14/08/07@05:03.21> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp /logs/timestats/ ~/$webscore"
(procedure "mx_userspeedsave" line 368)
invoked from within
"mx_userspeedsave"
(procedure "moxquiz_pubm" line 656)
invoked from within
"moxquiz_pubm $_pubm1 $_pubm2 $_pubm3 $_pubm4 $_pubm5"
14/08/07@05:03.27> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $newnick $host $handle $channel"
(procedure "moxquiz_on_nickchanged" line 10)
invoked from within
"moxquiz_on_nickchanged $_stnm1 $_stnm2 $_stnm3 $_stnm4 $_stnm5"
14/08/07@05:05.44> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $botnick "" "" $quizconf(quizchannel)"
(procedure "moxquiz_after_part" line 3)
invoked from within
"moxquiz_after_part"
14/08/07@05:05.45> : couldn't execute "/usr/bin/ncftpput": too many open files
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $botnick "" "" $quizconf(quizchannel)"
(procedure "moxquiz_after_part" line 3)
invoked from within
"moxquiz_after_part"
.
.
.
14/08/07@11:10.29> : moxquiz.mo.funpic.de: unknown host.
ncftpput: cannot open moxquiz.mo.funpic.de: unknown host.
while executing
"exec /usr/bin/ncftpput -V -a -m -f /home/eggdrop/moxquiz/scripts/ftpserver.ftp / ~/mox.html"
(procedure "mx_html" line 118)
invoked from within
"mx_html $botnick "" "" $quizconf(quizchannel)"
(procedure "moxquiz_after_part" line 3)
invoked from within
"moxquiz_after_part"
too many open files
The error occurs on random locations in the script. Unfortunately I can't find a file in the script that isn't closed after use. Reducing the files being opened doesn't seem to help. Is there a way to avoid the bot freezing due to this error other than restarting it all the time?
moxquiz.mo.funpic.de: unknown host.
this one is probably easier: how can I avoid to send a file to my webspace (per ftp) which ist temporarily down?
I guess one option might be to replace the open and close-commands with a proc featuring some debugging code; ie, rename open to _open, create a proc named open that calls _open, and tries to figure out number of opened files, where it was called from, and such.
Also, remember that sockets also make use of file descriptors, including the http-package..
Not sure this part might be to blame, but might be worth investigating:
variable newquest ""
package require http
setudef flag weather
set agent "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"
bind pub - !qread pub_w
bind pub - !qinsert pub_i
bind pub - !qcorrect pub_c
proc pub_w {nick uhand handle chan input} {
global botnick agent datadir newquest
if {![isop $nick $chan]} {
mxirc_notc $nick "Du musst Op sein, um diese Funktion auszuführen"
return
}
mxirc_quick_notc $nick "Neue Fragen werden eingelesen. Sollte der Befehl nicht funktionieren, probier zunächst !rehash."
set query "http://moxquiz.mo.funpic.de/fragen/neue_fragen.txt"
set http [::http::config -useragent $agent]
set http [::http::geturl $query]
set html [::http::data $http]
set questtime "[unixtime].txt"
set fname "$datadir/backup/$questtime"
set newquest $fname
set fp [open $fname "a"]
foreach line [split $html "\n"] {
puts $fp $line
}
close $fp