systemvm: FIX haproxy is not reloaded but restarted in VR#4384
Closed
ustcweizhou wants to merge 1 commit into
Closed
systemvm: FIX haproxy is not reloaded but restarted in VR#4384ustcweizhou wants to merge 1 commit into
ustcweizhou wants to merge 1 commit into
Conversation
when upgrade to cloudstack 4.14 or 4.15, there is no process ends with "/run/haproxy.pid" after reload haproxy. so haproxy is reloaded -> restarted -> reloaded -> restarted -> and so on After restarting haproxy ``` root@r-2040-VM:~# ps aux |grep /usr/sbin/haproxy root 24894 0.3 1.3 20492 13352 ? Ss 09:14 0:00 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid root 24895 0.1 1.1 22332 11372 ? Ss 09:14 0:00 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid ``` After reloading haproxy ``` root@r-2040-VM:~# systemctl reload haproxy root@r-2040-VM:~# ps aux |grep /usr/sbin/haproxy root 24894 0.0 1.3 20492 13300 ? Ss 09:14 0:00 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -sf 24895 root 26694 0.0 0.9 22196 9488 ? Ss 09:16 0:00 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -sf 24895 ``` so use 'grep' to find if haproxy is running.
yadvr
approved these changes
Oct 6, 2020
yadvr
reviewed
Oct 14, 2020
|
|
||
| proc = CsProcess(['/run/haproxy.pid']) | ||
| if not proc.find(): | ||
| if proc.grep("/usr/sbin/haproxy") == -1: |
Member
There was a problem hiding this comment.
haven't tested this, should this be !=0 instead @ustcweizhou ?
5 tasks
|
|
||
| proc = CsProcess(['/run/haproxy.pid']) | ||
| if not proc.find(): | ||
| if proc.grep("/usr/sbin/haproxy") == -1: |
Contributor
There was a problem hiding this comment.
@ustcweizhou this is the same fix done in the PR: #4386, changes in "CsRedundant.py" for keepalived process. As I've commented in that PR, on a broader view, other processes might have similar issue. can this be fixed in CsProcess.py ? else slowly at some point, we'll end up replacing all proc.find() with proc.grep().
Contributor
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2186 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
when upgrade to cloudstack 4.14 or 4.15, there is no process ends with "/run/haproxy.pid" after reload haproxy.
so haproxy is reloaded -> restarted -> reloaded -> restarted -> and so on
After restarting haproxy
After reloading haproxy
so use 'grep' to find if haproxy is running.
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?