Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-2007

standalone.sh fails to backup gc.log.#.current file silently.

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0.Alpha16
    • Component/s: Scripts
    • Environment:
      • Red Hat Enterprise Linux
      • This problem occurs on JBoss EAP 7.0.0.GA and later, but does not occur on EAP 6.4.x.
    • Steps to Reproduce:
      Hide
      1. Get rid of ">/dev/null" from line 265 in standalone.sh.
      2. Run standalone.sh for creating $JBOSS_LOG_DIR/gc.log.0.current file. Please ignore "No such file or directory" message (*1) printed out to the console at this time.
      3. Stop the server by Ctrl-C.
      4. Run standalone.sh again. The message (*1) will still be printed out to the console. The error (*1) at this time should not occur.

      Error message (*1)

      mv: cannot stat `/path/to/standalone/log/gc.log.*.current': No such file or directory
      
      Show
      Get rid of ">/dev/null" from line 265 in standalone.sh. Run standalone.sh for creating $JBOSS_LOG_DIR/gc.log.0.current file. Please ignore "No such file or directory" message (*1) printed out to the console at this time. Stop the server by Ctrl-C. Run standalone.sh again. The message (*1) will still be printed out to the console. The error (*1) at this time should not occur. Error message (*1) mv: cannot stat `/path/to/standalone/log/gc.log.*.current': No such file or directory
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Modify line 265 in standalone.sh as below:

      265c265
      <         mv "$JBOSS_LOG_DIR/gc.log.*.current" "$JBOSS_LOG_DIR/backupgc.log.current" >/dev/null 2>&1
      ---
      >         mv "$JBOSS_LOG_DIR"/gc.log.*.current "$JBOSS_LOG_DIR/backupgc.log.current" >/dev/null 2>&1
      
      Show
      Modify line 265 in standalone.sh as below: 265c265 < mv "$JBOSS_LOG_DIR/gc.log.*.current" "$JBOSS_LOG_DIR/backupgc.log.current" >/dev/ null 2>&1 --- > mv "$JBOSS_LOG_DIR" /gc.log.*.current "$JBOSS_LOG_DIR/backupgc.log.current" >/dev/ null 2>&1

      Description

      gc.log.*.current enclosed with double quotes in the following line (line 265) in standalone.sh is not evaluated as a wildcard by bash,

      mv "$JBOSS_LOG_DIR/gc.log.*.current" "$JBOSS_LOG_DIR/backupgc.log.current" >/dev/null 2>&1
      

      therefore standalone.sh fails to move an existing gc.log.<number>.current file to backupgc.log.current silently.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  gaol Lin Gao
                  Reporter:
                  gaol Lin Gao
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: