On Wednesday 23 September 2009 15:46:01 Vitaly Kuznetsov wrote: > Add '-u' key to bconsole to specify timeout for sending to/reading from > socket. If timeout occurs bconsole exits with "Timeout reached". > This is very usefull in scripts to diagnose that something goes wrong.
Hello Vitaly, Thank you for the patch. As I discussed with you when I was in Russia, this would be a nice feature for programs that are using bconsole to implement Bacula GUIs. However the patch that you sent is system dependent and will not work for example on Windows where there is no signal() or alarm() functions. I mentioned to you that Bacula has its own timers, which are not system dependent, so what you need to do is make a few minor modifications to the code to use a Bacula timer rather than an alarm(). There are three timer mechanisms in Bacula, all work nearly identically, but they are for different situations: 1. Child timers (I don't think you want this). 2. Thread timers. This is more general than the socket timer in that it works with any system call that can be interrupted. 3. socket timers (this is probably what you want). It is specific to sockets. The timer code is defined in src/lib/btimers.c, and an example of using a bsock timer can be found in src/console/authenticate.c. As it stands, bconsole does very little of the daemon initialization, so to get Bacula timers working, you will need to add a call to start the watchdog (timing) code. See: src/dird/dird.c for how to start the watchdog (one subroutine call). You will also need to terminate it at the end of bconsole. I look forward to seeing your modifications. Thanks for helping with Bacula :-) Best regards, Kern ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
