> here the output of "upsd -DDDDD" when starting "upsc [EMAIL PROTECTED]
> ups.status" (and stopping after 20-30 sec with an ctrl+c)

Ah, you have a problem with 'upsc' rather than with 'upscmd' like you
stated before. That changes things.

> Connection from 127.0.0.1
> acl_check: localhost: match 1
> ACL [localhost] matches, action=1
> write: [destfd=6] [len=24] [VAR apc ups.status "OL"]

This looks (almost) good, apparently upsd got a request to send the value
of 'ups.status' and decoded this properly. It sends [VAR apc ups.status
"OL"] in return, which looks good at first glance. But it isn't... ;-)

Yesterday I committed a change to upsd.c to remove the trailing '\n' in
debug mode, since that would break the line with 'write: ...' on it, which
looked rather ugly. Bummer, since the rtrim() function that I used will
strip it from the answer sent to the connecting client also, the answer
will now be shorter than expected and miss the trailing '\n'
(server/upsd.c):

int sendback(ctype *client, const char *fmt, ...)

[...]
        upsdebugx(2, "write: [destfd=%d] [len=%d] [%s]",
                client->fd, len, rtrim(ans, '\n'));

        if (client->ssl)
                res = ssl_write(client, ans, len);
        else
                res = write(client->fd, ans, len);

The solution is to move the line with upsdebugx to after the lines writing
this to the client. I will commit this fix later today. This is an
unrelated problem from the staleness warnings though.

Best regards, Arjen


_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to