Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-13734

opennms.spec file tries to find out if gid 1000 is used but doesn't actually check hat

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • 29.0.0
    • 29.0.1
    • Build / Packaging
    • Security Level: Default (Default Security Scheme)
    • None
    • 1
    • Horizon 2021 - Nov 11 - Dec 1

    Description

      I have tried to update to 29 from 28.1.1 and the opennms-core failed with errors:

       

      groupadd: GID '1000' already exists
      useradd: group 'opennms' does not exist
      error: %pre(opennms-core-29.0.0-1.noarch) scriptlet failed, exit status 6
      Error in PREIN scriptlet in rpm package opennms-core-29.0.0-1.noarch
      {{ Updating : opennms-webapp-jetty-29.0.0-1.noarch 2/6 }}
      error: opennms-core-29.0.0-1.noarch: install failed
      warning: user opennms does not exist - using root
      warning: group opennms does not exist - using root
      ...

       

      The problem is here:

       

      https://github.com/OpenNMS/opennms/blob/197be4074c778465fb286901e2332223e550a16d/tools/packages/opennms/opennms.spec#L883

       if ! id -g 1000 >/dev/null 2>&1; then

      It's supposed to check if gid number 1000 is used or not, but in fact only shows the effective gid of the user with uid 1000.

      Now if you don't have a user with uid 1000 but you do have a group with gid 1000 this completely breaks the update as neither opennms user nor group gets created but used a lot afterwards...

      To be honest: I don't like using fixed gid or uid numbers anyway. By default, 1000 is the first id number for standard accounts, not system accounts.

      Just let the system allocate a number and don't try to force 1000 onto it...

      Attachments

        Activity

          People

            ranger Benjamin Reed
            gvde Gerald Vogt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: