Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-3880

/sbin/poweroff et al or ACPID initiated shutdown does not stop cloudstack-[usage|management]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.1.1
    • Future
    • Management Server, Usage
    • Security Level: Public (Anyone can view this level - this is the default.)
    • manager running on RHEL64 (variant, OEL64)

    Description

      cloudstack-management has custom stop() that does not handle finding the PID file if invoked via S|K runlevel links. Interactive use works.
      cloudstack-usage start() does not create the /var/run/subsys lockfile causing the stop() function to not be invoked. Interactive use works.
      cloudstack-usage lacks runlevel # settings, causing default 50 to be selected and this causes stop() to run after mysqld has been shutdown.

      effect of this can be data base corruption

      Here is a possible fix;

      [root@slc00xfr rc.d]# diff -c -r init.d.ref init.d
      diff -c -r init.d.ref/cloudstack-management init.d/cloudstack-management

          • init.d.ref/cloudstack-management 2013-07-26 17:33:05.000000000 +0100
          • init.d/cloudstack-management 2013-07-27 18:36:43.000000000 +0100
            ***************
          • 44,49 ****
          • 44,52 ----

      NAME="$(basename $0)"
      stop() {
      + if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
      + NAME="${NAME:3}"
      + fi
      SHUTDOWN_WAIT="30"
      count="0"
      if [ -f /var/run/${NAME}.pid ]; then
      diff -c -r init.d.ref/cloudstack-usage init.d/cloudstack-usage

          • init.d.ref/cloudstack-usage 2013-07-26 17:33:05.000000000 +0100
          • init.d/cloudstack-usage 2013-07-27 18:36:53.000000000 +0100
            ***************
          • 2,7 ****
          • 2,8 ----
          1. BEGIN INIT INFO
      1. Provides: cloud usage
        + # chkconfig: - 79 21
      2. Required-Start: $network $local_fs
      3. Required-Stop: $network $local_fs
      4. Default-Start: 3 4 5
        ***************
          • 96,101 ****
          • 97,103 ----

      if [ $rc -eq 0 ]; then
      success
      + touch $LOCKFILE
      else
      failure
      rm -f "$PIDFILE"
      [root@slc00xfr rc.d]#

      Attachments

        Activity

          People

            Unassigned Unassigned
            oewerlid Ove Ewerlid
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: