You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Ove Ewerlid (JIRA)" <ji...@apache.org> on 2013/07/27 20:25:49 UTC

[jira] [Created] (CLOUDSTACK-3880) /sbin/poweroff et al or ACPID initiated shutdown does not stop cloudstack-[usage|management]

Ove Ewerlid created CLOUDSTACK-3880:
---------------------------------------

             Summary: /sbin/poweroff et al or ACPID initiated shutdown does not stop cloudstack-[usage|management]
                 Key: CLOUDSTACK-3880
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3880
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Management Server, Usage
    Affects Versions: 4.1.1
         Environment: manager running on RHEL64 (variant, OEL64)
            Reporter: Ove Ewerlid
            Priority: Blocker
             Fix For: 4.1.1


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 ----

  ### BEGIN INIT INFO
  # Provides:          cloud usage
+ # chkconfig: - 79 21
  # Required-Start:    $network $local_fs
  # Required-Stop:     $network $local_fs
  # 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]#


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira