Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2825

Returns exit code 0 in case of Mongo fail to start

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.8.0-rc1
    • 2.1.0
    • Admin
    • None
    • Linux 2.6.37-ARCH #1 SMP PREEMPT Tue Mar 15 09:21:17 CET 2011 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ AuthenticAMD GNU/Linux
    • Linux

    Description

      In case of unclean shutdown mongo fail to start, but returns exit code 0.
      Exit code matters when used in startup scripts.
      Look at this piece of code from my ArchLinux's mongodb startup script. Here we try to start mongo an then check exit code. Mongo should return correct exit codes.
      [ -z "$PID" ] && /bin/su mongodb -s /bin/bash -c "/usr/bin/mongod --config /etc/mongodb.conf &" > /var/log/mongod 2>&1
      if [ $? -gt 0 ]; then
      stat_fail
      else
      add_daemon mongodb
      stat_done
      fi

      Attachments

        Activity

          People

            brandon Brandon Diamond
            jesu Artyom Bolshakov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: