Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13087

bin/solr's use of whoami can produce warnings

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 8.4, 9.0
    • SolrCLI
    • None

    Description

      The bin/solr script uses whoami to determine if it is running as root.
      That code is here and was introduced with this commit for SOLR-7826

      This can produce a warning if the effective uid is not present in /etc/passwd.
      For example:

      $ docker run -it -u 88888 bash bash -c 'whoami'
      whoami: unknown uid 88888
      

      This is an unusual situation, but one I encountered and worked around

      The use of whoami can be avoided by using id -u, or better yet $UID$EUID which is built into bash and thus also avoids a subshell invocation. I'm not aware of any downside to this approach.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            gerlowskija Jason Gerlowski
            makuk66 Martijn Koster
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment