networkupstools / nut

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!
https://networkupstools.org/
Other
2.03k stars 349 forks source link

Add a timeout option to client commands #7

Open aquette opened 11 years ago

aquette commented 11 years ago

upsc, upscmd and upsrw should provide a -t timeout option. Underlying mechanism is already available in libupsclient->upscli_tryconnect(...).

Alioth patch #313881 https://alioth.debian.org/tracker/index.php?func=detail&aid=313881&group_id=30602&atid=411544

An external contributor (Imene Guerfa) is already working on this.

cnaslain commented 4 months ago

I run upsc as an healthcheck command and sometime; it never returns and the number of ghosts process increases indefinitely. Having a timeout option would be great to fail the upsc command if it does not returns in time.

Running Network UPS Tools upsc 2.8.2 in docker with upsc ups-montcalm@localhost 2>&1 | grep stale -c && exit 1 || exit 0 healthcheck command.