Return-Path: X-Original-To: apmail-cloudstack-issues-archive@www.apache.org Delivered-To: apmail-cloudstack-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8481F10294 for ; Sat, 3 Aug 2013 01:51:49 +0000 (UTC) Received: (qmail 57460 invoked by uid 500); 3 Aug 2013 01:51:49 -0000 Delivered-To: apmail-cloudstack-issues-archive@cloudstack.apache.org Received: (qmail 57442 invoked by uid 500); 3 Aug 2013 01:51:49 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 57434 invoked by uid 500); 3 Aug 2013 01:51:49 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 57431 invoked by uid 99); 3 Aug 2013 01:51:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Aug 2013 01:51:49 +0000 Date: Sat, 3 Aug 2013 01:51:49 +0000 (UTC) From: "Abhinandan Prateek (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CLOUDSTACK-3880) /sbin/poweroff et al or ACPID initiated shutdown does not stop cloudstack-[usage|management] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-3880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Abhinandan Prateek updated CLOUDSTACK-3880: ------------------------------------------- Assignee: Koushik Das > /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 > Assignee: Koushik Das > Priority: Critical > Labels: patch > 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