Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-13211

Use portable stderr for java error in startup

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Normal

    Description

      The cassandra startup shell script contains this line:

      echo Unable to find java executable. Check JAVA_HOME and PATH environment variables. > /dev/stderr

      The problem here is the construct "> /dev/stderr". If the user invoking Cassandra has changed user (for example, by SSHing in as a personal user, and then sudo-ing to an application user responsible for executing the Cassandra daemon), then the attempt to open /dev/stderr will fail, because it will point to a PTY node under /dev/pts/ owned by the original user.

      Ultimately this leads to the real problem being masked by the confusing error message "bash: /dev/stderr: Permission denied".

      The correct technique is to replace "> /dev/stderr" with ">&2" which will write to the already open stderr file descriptor, instead of resolving the chain of symlinks starting at /dev/stderr, and attempting to reopen the target by name.

      Attachments

        Activity

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

          People

            mshuler Michael Shuler Assign to me
            maxb Max Oliver Bowsher
            Michael Shuler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment