[Nut-upsdev] i'm confused
Nicholas Byrne
nicholas.byrne at quadriga.com
Fri May 18 18:13:17 UTC 2007
Hi all,
New to NUT dev, i was hoping someone can clear up an issue i have with
the unix socket naming for me (FYI my C is not that great). I'm using
2.0.5 and this stems from a problem with the general admin of Nut but
looking at the code led me to think maybe it's a bigger issue (thus i
joined this list).
Right to start with if i have the following in ups.conf:
[apc]
driver=apcsmart
port=/dev/ttyS0
desc="Test UPS"
and in upsd.conf among other items i have the following because i
compiled with this state dir :
STATEPATH /var/run/nut
upsd fails with "upsd[2947]: Can't connect to UPS [apc] (apc): No such
file or directory".
So i looked at the code for and found that in drivers/dstate.c
dstate_init function creates the socket as follows -
snprintf(sockname, sizeof(sockname), "%s/%s-%s",
dflt_statepath(), prog, port);
which is fine, but if i'm right upsd via server/conf.c in function
upsconf_add is trying set the name of the socket to be opened as -
snprintf(statefn, sizeof(statefn), "%s",
tmp->upsname);
so it error's as above. If i call the entry in ups.conf 'apcsmart-ttyS0'
then it'll work because upsd will use the upsname, but from looking at
the docs, examples and so on it appears i can use any arbitrary string
in ups.conf for the name?
Have i missed something really obvious (probably) or does everyone
create entries called '[drivername-port]'?!
Thanks
Nick
This e-mail is the property of Quadriga Worldwide Ltd, intended for the addressee only and confidential. Any dissemination, copying or distribution of this message or any attachments is strictly prohibited.
If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer.
Messages sent to and from Quadriga may be monitored.
Quadriga cannot guarantee any message delivery method is secure or error-free. Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission.
You should carry out your own virus checks before opening any attachment.
Any views or opinions presented are solely those of the author and do not necessarily represent those of Quadriga.
More information about the Nut-upsdev
mailing list