Chat Daemon Server

Chat Daemon Server

by Athail Pulino -
Number of replies: 7
Hi, folks!

I am in trouble with the Chat module.
Since version 1.5.2 we, at the University of Brasilia, in Brazil, are trying to use the daemon server (in order to improve de chat performance) mode and the server do not work at all. Now we are running Moodle 1.5.4+ .
We use FreeBSB in one installation and Debian Sarge in other. The problem occurs on both installations.


Any advice?
Thanks.

Athail Pulino
Average of ratings: -
In reply to Athail Pulino

Re: Chat Daemon Server

by Matt Gibson -

Hi Athail,

Can you give us any more details of what errors you are getting and what procedures your are following to try to get the Daemon started?

Matt

In reply to Matt Gibson

Re: Chat Daemon Server

by Marco Aurelio Miranda -
Hi,

I work with Athail at University of Brasilia. I'm responsible for the technical issues. The problem with the FreeBSD and RedHat (not Debian) are distinct. Right now I'm concerned about the chat deamon running on RedHat. It's a Red Hat Enterprise Linux ES release 4 (Nahant Update 4) with Apache 2.0.52 , PHP 4.3.9, mysql 4.1.20 and moodle 1.6.1+ . I wrote a init script so the chat daemon starts at boot:

[root@www ~]# cat /etc/init.d/moodlechatd
#!/bin/sh

moodlepath=/var/www/html/moodle

if [ $# -lt 1 ]
then
echo "Usage: moodlechatd [start|stop|restart]"
fi

start(){
echo -n "Starting Chat Daemon for Moodle:"
cd $moodlepath/mod/chat/
/usr/bin/php chatd.php --start -l &
echo -n "OK"
echo
}

stop(){

echo -n "Stopping Chat Daemon for Moodle:"
pid=$(pidof /usr/bin/php chatd.php)
kill $pid
echo -n "OK"
echo
}

case $1 in

start)
        start
        ;;
stop)
        stop
        ;;
restart)
        stop
        start
        ;;
*)
echo "Usage: moodlechatd [start|stop|restart]"
esac

Now, this is the chatd.log:

[2006-10-04 19:55:23] *IMPORTANT* Started Moodle chatd on port 9111, listening socket Resource id #23
[2006-10-04 19:55:32] *IMPORTANT* Connection accepted: Resource id #24, SID: RG7RnZMOm1lsJ0qZlkcKagYLGWEzJ5oe UID: 11 GID: 0
[2006-10-04 19:56:05] *IMPORTANT* Connection accepted: Resource id #58, SID: mOfQUoo1wMQEd7QuYPuTuAxUA2NiQPQ6 UID: 3 GID: 0
[2006-10-04 19:56:06] *IMPORTANT* Connection accepted: Resource id #64, SID: AzqhUlyrYnd1N2ccgYv2DisJbkcbron0 UID: 55 GID: 0
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686
[2006-10-04 19:58:45]  *CRITICAL* [php] socket_select(): 57 is not a valid Socket resource on line 686


This CRITICAL message keeps repeating. Sometimes the daemon crashes - mostly when Admin logs into the chat - and I have to restart it.

Any idea?

thanks in advance,
Marco Aurelio.
In reply to Marco Aurelio Miranda

Re: Chat Daemon Server

by Paulo Matos -
I'm about to try this on the same conditions, have you been able to track or solve this issue?

Regards,

Paulo
In reply to Marco Aurelio Miranda

Re: Chat Daemon Server

by Douglas Ianitsky -
[2007-10-18 21:54:43] *CRITICAL* [php] socket_select(): 297 is not a valid
Socket resource on line 687


The error is in the "conn_activity_ufo" (If I am wrong someone correct me) I realized that it serves after some time to check the open connections, but it is trying to select a soquet that does not exist. Still unable to a clearance of this function, but someone who has had this problem has solve it?
In reply to Marco Aurelio Miranda

Re: Chat Daemon Server

by Luciano Rodriguez -
Has anybody try this on Moodle 1.8.2 with PHP5.2.2 + Apache 1.3? I still can't get it going.
In reply to Luciano Rodriguez

Re: Chat Daemon Server

by Luciano Rodriguez -
Update,
I was able to get it going. The only thing is that the process is crashing after about a day. The problem was because we are clustering 5 xserves together on private networks and all going through a load balancer. Now I am trying to figure out why its messing up after a day. smile
In reply to Luciano Rodriguez

Re: Chat Daemon Server

by Luciano Rodriguez -
Another update:
I was able to get moodle chat daemon to work using the built in php4 that came installed with one of my servers. I invoked it with the command line command and now it seems to be up and working with little to no problems.