[
https://issues.apache.org/jira/browse/CLOUDSTACK-8815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14970878#comment-14970878
]
ASF subversion and git services commented on CLOUDSTACK-8815:
-------------------------------------------------------------
Commit 2b34df0da49959c5ba6eb694f0469e9e883f2d4d in cloudstack's branch
refs/heads/master from [~remibergsma]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=2b34df0 ]
Merge pull request #799 from sudhansu7/CLOUDSTACK-8815
CLOUDSTACK-8815 : Issues with cloudstack-management init script
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.
screenshots:
Before fix:

After fix:

* pr/799:
CLOUDSTACK-8815 : Issues with cloudstack-management init script
Signed-off-by: Remi Bergsma <[email protected]>
> 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)