Skip to content

gen-snmp-subdriver.sh hangs #3308

@darkglade

Description

@darkglade

Hi All,

Been trying to use gen-snmp-subdriver.sh to generate a stub for my Eaton/Liebert GXT4 UPS with an IS-WEBCARD management interface, I thought the SNMP walk was just taking a really long time for some reason but in checking the process listing (and embroidering the script with some temporary debug statements) it's actually these lines from the file (490-491);

${EGREP} "^[ ${TABCHAR}]?\$" | ${GREP} "End of MIB" | ${GREP} -v "${NUMWALKFILE}" > "${TMP_NUMWALKFILE}"
${EGREP} "^[ ${TABCHAR}]?\$" | ${GREP} "End of MIB" | ${GREP} -v "${STRWALKFILE}" > "${TMP_STRWALKFILE}"

Unless I'm completely missing something (or my shell is doing something very different to what the committer's was) I can't see how that's ever going to do anything BUT hang? There's no file input to any of the grep commands in the chain until the last one so there's never anything on STDIN so it never actually does anything?

Seems like this change was specifically to avoid the use of -e so I presume that's not well supported, I think that the following should work and satisfy the criteria (certainly works fine for me, though my snmpwalks are NOT generating any blank lines or "End of MIB" lines)

${EGREP} -v "^[ ${TABCHAR}]?\$" "${NUMWALKFILE}" | ${GREP} -v "End of MIB" > "${TMP_NUMWALKFILE}"
${EGREP} -v "^[ ${TABCHAR}]?\$" "${STRWALKFILE}" | ${GREP} -v "End of MIB" > "${TMP_STRWALKFILE}"

Happy to raise a PR for it, but just wanted to sanity check first in case I'm completely missing something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIEntries related to continuous integration infrastructure (here CI = tools + scripts + recipes)SNMPbugportabilityWe want NUT to build and run everywhere possible

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions