Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23463

bin/scripts/rhel/solr restart & stop does not work

    XMLWordPrintable

Details

    Description

      /etc/init.d/solr tries to redirect stderr output to /dev/null in some places, but does it the wrong way, using 2&>1 instead of 2>&1. This leads to:

      • the file '1' begin created in the current directory
      • /etc/init.d/solr restart not working because killproc does not work when given another argument (2).
      diff -u
      @@ -60,26 +54,26 @@
       }
      
       d_stop() {
      -    killproc -p /var/run/solr.pid $NAME >> /dev/null 2&>1
      +    killproc -p /var/run/solr.pid $NAME >> /dev/null 2>&1
           RETVAL=$?
           [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME
           return $RETVAL
       }
      
       d_restart() {
      -    d_stop >> /dev/null 2&>1
      +    d_stop >> /dev/null 2>&1
           sleep 1
      -    d_start >> /dev/null 2&>1
      +    d_start >> /dev/null 2>&1
       }
      
       d_reload() {
      -    killproc -p /var/run/solr.pid $NAME -HUP 2&>1
      +    killproc -p /var/run/solr.pid $NAME -HUP 2>&1
           RETVAL=$?
           return $RETVAL
       }
      
       d_status() {
      -    status -p /var/run/solr.pid $NAME >> /dev/null 2&>1
      +    status -p /var/run/solr.pid $NAME >> /dev/null 2>&1
           return $?
       }
      

      Also, the & after the daemon command in d_start, wich makes it start in the background, has the effect that $? is always zero.

      No file attached - I will do this in the next report, which is about a worse problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Alex.Schuster@ibexa.co Alex Schuster
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: