Project

General

Profile

Actions

Bug #310

closed

Nut needs changes for latest version

Added by Chris Buechler almost 15 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
Nut
Target version:
-
Start date:
01/17/2010
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Actions #1

Updated by Marcus van Dam over 14 years ago

I got the recognition of the serial ports to work.

        function before_form_nut($pkg) {
                /* return available serial ports */
                $handle = popen('dmesg | grep \'^uart[0-9]: \[FILTER\]\'','r');
                $read = fread($handle, 2096);
                pclose($handle);

                /* explode at the newlines */
                $read = explode("\n",$read);

                /* parse resulting text */
                foreach($read as $line) {
                        if($line!= '') {
                                $names[] = 'ttyu'.$line{4}.' (COM'.($line{4}+1).')';
                                $values[] = '/dev/ttyu'.$line{4};
                        }
                }

                /* find correct field */
                $i = 0;
                foreach ($pkg['fields']['field'] as $field) {
                        if ($field['fieldname'] == 'port')
                                break;
                        $i++;
                }
                $field = &$pkg['fields']['field'][$i];

                /* add available serial ports */
                for ($i = 0; $i < count($values) ; $i++)
                        $field['options']['option'][] = array('name' => $names[$i], 'value' => $values[$i]);
        }

The only thing i can find about the new ACL is this:

 - tcp-wrappers support has been added to the upsd server, to grant users access
   by source IP for commands that require to be logged into the server. This
   replaces the previous internal implementation (ACL in upsd.conf).

Unfortunately i do not know how to fix that.

Actions #2

Updated by Chris Buechler over 14 years ago

  • Status changed from New to Resolved

this is fixed in the latest package version.

Actions #3

Updated by Marcus van Dam over 14 years ago

Correct port detection still not implemented. Patch from first post still needed.
The new ACL works perfectly now.

Actions #4

Updated by Chris Buechler over 14 years ago

  • Status changed from Resolved to New
Actions #5

Updated by Marcus van Dam almost 14 years ago

I don't want to be the inpatient en annoying guy,
But could someone implement a fix so it recognizes both types of serial ports correctly? You would do be a really big favor!

Actions #6

Updated by Criggie . almost 13 years ago

I think I'm having a similar problem. I've got nut working on an alix with a USB/serial adapter, however the "auto" port function doesn't work.

The fix is to twiddle the ports option list in /usr/local/pkg/nut.xml manually and add the correct choices
Described at http://forum.pfsense.org/index.php/topic,43283.0.html

I know this isn't elegant, and it does get overwritten any time I upgrade.

However users already have to pick their UPS model and cable type from a list. Why not simply provide a list of all reasonable port choices?

Actions #7

Updated by Jim Pingle almost 12 years ago

  • Status changed from New to Closed

This was fixed up a while ago.

Actions

Also available in: Atom PDF