[Nut-upsdev] [Nut-upsuser] Problems starting upsd

Arjen de Korte nut+users at de-korte.org
Wed May 30 08:34:09 UTC 2007


>>
>>> Here's what's happening when i try to start the ups daemon:
>>>
>>> [root at corporate log]# [root at corporate all]# service ups start
>>> Starting megatec: Network UPS Tools - Megatec protocol driver 1.5
>>> (2.0.5)
>>> Carlos Rodrigues (c) 2003-2006
>>>
>>> Megatec protocol UPS detected [ Pro 1400 4.01p].
>>>                                                            [  OK  ]
>>> Starting upsd: Network UPS Tools upsd 2.0.5
>>> Can't connect to UPS [upguards] (upguards): No such file or directory
>>>                                                            [  OK  ]
>>
>> The startup script is probably not using 'upsdrvctl' to start the
>> driver,
>> but starts the driver directly. This is wrong. Talk to whoever wrote
>> this
>> script, we didn't.
>>
>>> Starting UPS monitor (master): Network UPS Tools upsmon 2.0.5
>>> UPS: upguards at localhost (master) (power value 1)
>>> Using power down flag file /etc/killpower
>>>
>>>                                                            [  OK  ]
>>> [root at corporate all]#
>>> Broadcast message from nut (Mon May 28 12:41:24 2007):
>>>
>>> Communications with UPS upguards at localhost lost
>>>
>>> Broadcast message from nut (Mon May 28 12:41:29 2007):
>>>
>>> UPS upguards at localhost is unavailable
>>
>> Sure, the socket the driver uses has a different name than the server
>> expects.
>>
>>> The ups.conf file contains only these lines:
>>>
>>> [upguards]
>>>     driver = megatec
>>>     port = /dev/ttyS1
>>>     desc = "UPguardS Pro 1400"
>>
>> Your 'ups.conf' file is fine.
>>
>>> The funny thing is that when the power to the server was not supplied
>>> by
>>> the ups all worked fine but when i go through the ups the daemon fails.
>>
>> This is not related.
>>
>>> I've checked permissions, and i have the user nut that is in the group
>>> uucp and that group can read and write to ttyS1
>>>
>>> I cannot seem to find who is causing the No such file or directory
>>> error
>>> message when the daemon starts up.
>>>
>>> Another weird thing is if i start the driver manually and then the
>>> daemon
>>> all is fine and working !
>>
>> This is indicative for problems in the startup script.
>>
>> Best regards, Arjen
>> --
>> Eindhoven - The Netherlands
>> Key fingerprint - 66 4E 03 2C 9D B5 CB 9B  7A FE 7E C1 EE 88 BC 57
>>
>>
>
> Thanks for your answer !

Please keep the mailinglist posted. Others may benefit from the solution
to the problem you experienced.

> As i looked through the init.d startup script i see upsdrvctl it's not
> used to start the driver instead the script calls the specific driver
> binary...
>
> This procedure is wrong to start the ups daemon ?

Yes, and it has been for quite a while actually.

> here's the start section of the script:

[...]

This looks a lot like the standard RedHat script that is included in the
NUT sources. This script also uses '/etc/sysconfig/ups' where some
parameters can be configured, among these the MODEL (see below):

# Model of the UPS (filename to call for it, without path)
# Example - one of
#	apcsmart	- APC SMartUPS and similar
#	fentonups	- Fenton UPS
#	optiups
#	bestups
#	genericups
#	ups-trust425+625
#  upsdrvctl
# You MUST change this, or set SERVER to "no"
# To support multiple drivers, set MODEL=upsdrvctl
MODEL=NONE
# UPS device - needed if UPS is locally attached
DEVICE=/dev/ttyS0
# Any options to pass to $MODEL
# ex. for my TrippLite UPS, use
#	OPTIONS="-t 5"
OPTIONS=

You need to set MODEL to 'upsdrvctl' and configure the UPS in 'ups.conf'.
I'm not the maintainer of the RedHat packaging, but I think we need to
change something here (remove the configuration of the MODEL, DEVICE and
OPTIONS from this file). The old method of starting drivers directly can't
be used anymore, since the socketname will be set incorrectly (like you've
seen now). The init script should use 'upsdrvctl' to start the driver(s).

Best regards, Arjen




More information about the Nut-upsdev mailing list