[ https://issues.apache.org/jira/browse/CLOUDSTACK-8815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14900522#comment-14900522 ]
ASF GitHub Bot commented on CLOUDSTACK-8815: -------------------------------------------- Github user sudhansu7 commented on the pull request: https://github.com/apache/cloudstack/pull/799#issuecomment-141945369 @bhaisaab For CentOS 7 we have we cloud-management.service and cloud-management.config files. I don't see any other .rc file for cloud-management service. cloud-management.service [Unit] Description=CloudStack Management Server After=syslog.target network.target [Service] Type=forking ExecStart=/usr/sbin/tomcat-sysd start ExecStop=/usr/sbin/tomcat-sysd stop SuccessExitStatus=143 User=cloud Group=cloud EnvironmentFile=/etc/sysconfig/cloudstack-management [Install] WantedBy=multi-user.target cloud-management.config : # Required for a tocmat cloned service SERVICE_NAME=cloudstack-management # Where your java installation lives #JAVA_HOME="/usr/lib/jvm/java" @remibergsma I scanned through the packaging folder and found another instance (cloud-ipallocator.rc) where the basename is directly used for referring PID file and fixed the same. Below is the grep result before and after the fix. Before: Sudhansus-MAC:packaging sudhansu$ grep 'basename' */*.rc centos63/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') centos63/cloud-ipallocator.rc:SHORTNAME=`basename $0` centos63/cloud-management.rc:NAME="$(basename $(readlink -f $0))" centos7/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') centos7/cloud-ipallocator.rc:SHORTNAME=`basename $0` fedora20/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') fedora20/cloud-ipallocator.rc:SHORTNAME=`basename $0` fedora20/cloud-management.rc:NAME="$(basename $(readlink -f $0))" fedora21/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') fedora21/cloud-ipallocator.rc:SHORTNAME=`basename $0` fedora21/cloud-management.rc:NAME="$(basename $(readlink -f $0))" After: Sudhansus-MAC:packaging sudhansu$ grep 'basename' */*.rc centos63/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') centos63/cloud-ipallocator.rc:SHORTNAME="$(basename $(readlink -f $0))" centos63/cloud-management.rc:NAME="$(basename $(readlink -f $0))" centos7/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') centos7/cloud-ipallocator.rc:SHORTNAME="$(basename $(readlink -f $0))" fedora20/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') fedora20/cloud-ipallocator.rc:SHORTNAME="$(basename $(readlink -f $0))" fedora20/cloud-management.rc:NAME="$(basename $(readlink -f $0))" fedora21/cloud-agent.rc:SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') fedora21/cloud-ipallocator.rc:SHORTNAME="$(basename $(readlink -f $0))" fedora21/cloud-management.rc:NAME="$(basename $(readlink -f $0))" > Issues with cloudstack-management init script > --------------------------------------------- > > Key: CLOUDSTACK-8815 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8815 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Install and Setup > Reporter: Sudhansu Sahu > Assignee: Sudhansu Sahu > Attachments: screenshot-1.png, screenshot-2.png > > > When a management server is halted or rebooted, the cloudstack-management > init script does not successfully kill the associated java process. There > will always be an error about "Cannot find PID file". The script should be > reworked so that there are no errors and java is killed correctly. > This appears to be due to the script using the basename of the script: > NAME="$(basename $0)" > To look for the pid file: > if [ -f /var/run/$ > {NAME} > .pid ]; then > This does work correctly if the script is run directly (basename will be > "cloudstack-management", so "cloudstack-management.pid" file is found). > However when a server is halted or rebooted, the script is not run directly > but via the symlinks in /etc/rc.d/rc0.d/ and /etc/rc.d/rc0.d/, respectively. > The symlinks are named "K20cloudstack-management" so the script looks for a > pid file named "K20cloudstack-management.pid" which does not exist. -- This message was sent by Atlassian JIRA (v6.3.4#6332)