Jim Klimov
2013-Jan-09 17:39 UTC
[Nut-upsdev] Is there any "fake UPS" driver (and Solaris 10+ integration)?
Hello all, I am a long-time user of NUT (since last millennium, or so it seems) and beside Linux where I've started, I also integrated it with our Solaris 8 and 9 servers' shutdown procedures - avoiding the possible "hole" when the line power returns right at the bad moment when UPSes and systems are already told to power off. In this case, they see no event like "I am off, power returned" and don't come back online. This happens surprisingly more often than one would think ;) The recommended solution at that time was to turn off services, sync the disks and wait for the UPS to deplete - or reboot the OS after a long timeout (15min or so). This worked like a charm for me on Linux and older Solarises, where OS init was managed by scripts - where my package installation could hack into. Some time in the Solaris 10 (now valid for sol10, sol11, OI and its other relatives) the OS lifetime management changed from scripts to a compiled program (bootadm) integrated with SMF, which includes a forced kill of all processes after a hardcoded shutdown timeout, so the proper procedure to avoid the "hole" became tricky - and the old solution no longer works completely properly. For some time I've been meaning to dig into the problem, and found that I need a tool to emulate poweroffs for a testbed (VM likely). What better tool would it be than a fake UPS driver that reports to NUT clients whatever I feed it (via pipe or some other mechanism)? So I thought the NUT devs would likely have this for a long time ;) A cursory google search found no relevant hits, so I guess this fake UPS driver is not published - or I used wrong keywords... So: is there any ready-to-use tool/technique to fool NUT clients into believing they are OnLine/OnBattery/Critical and must shutdown, so that I can test and debug the OS-side shutdown procedures without really toggling power on hardware systems? Thanks, //Jim Klimov
Kiss Gabor (Bitman)
2013-Jan-09 17:53 UTC
[Nut-upsdev] Is there any "fake UPS" driver (and Solaris 10+ integration)?
> For some time I've been meaning to dig into the problem, and found > that I need a tool to emulate poweroffs for a testbed (VM likely). > What better tool would it be than a fake UPS driver that reports > to NUT clients whatever I feed it (via pipe or some other mechanism)? > > So I thought the NUT devs would likely have this for a long time ;) > A cursory google search found no relevant hits, so I guess this fake > UPS driver is not published - or I used wrong keywords... So: is there > any ready-to-use tool/technique to fool NUT clients into believing > they are OnLine/OnBattery/Critical and must shutdown, so that I can > test and debug the OS-side shutdown procedures without really toggling > power on hardware systems?Maybe this solves your problem: http://www.networkupstools.org/docs/man/dummy-ups.html Regards Gabor