On Mon, Apr 21, 2008 at 09:36:07AM +0200, Arjen de Korte wrote: > John Darrah wrote: >> I have determined that the the socket is never created because the program >> never reaches dstate_init(). > > It *must* reach this, otherwise it would never reach the part where it > continuously loops through upsdrv_updateinfo(). > > [...] > >> The following is a section of upsdrv_initups() that i places printf's and >> noted that it never makes it to the second one shown below. Is stdout being >> closed somewhere? > > Yes, but only when running in not running in debug mode. Please run the > driver with debug level '-DD' (not higher!) and post the *full* output > of the first 30 seconds after that here. >
Attached is approx 30 sec of output from the following command:
# /usr/src/nut-2.2.1/drivers/usbhid-ups -u root -DD -a trippy > poop.out 2>&1
No extra code or printf's are in the the above exec.
Note that "dstate_init: sock..." does not appear in the output.
FYI: In one test, add the following to dstate_init... It's almost as if
it is not even being called???
void dstate_init(const char *prog, const char *port)
{
char sockname[SMALLBUF];
fprintf(stderr, "@@@2 i made it here!\n"); <<<--- i never see this
exit(1); <<<------- this does not cause it to exit???
/* do this here for now */
signal(SIGPIPE, SIG_IGN);
fprintf(stderr, "@@@3 i made it here!\n");
if (port != NULL)
snprintf(sockname, sizeof(sockname), "%s/%s-%s",
dflt_statepath(), prog, port);
else
snprintf(sockname, sizeof(sockname), "%s/%s",
dflt_statepath(), prog);
sockfd = open_sock(sockname);
upsdebugx(2, "dstate_init: sock %s open on fd %d", sockname, sockfd);
<<<--- not in the debug output???
}
--
John
usbhid.out.gz
Description: Binary data
_______________________________________________ Nut-upsuser mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

