Haproxy process cannot restart or be killedApache2/fastcgi/php fastcgi/haproxy - graceful restart problems...
What is the dot in “1.2.4."
What Happens when Passenger Refuses to Fly Boeing 737 Max?
Best approach to update all entries in a list that is paginated?
My story is written in English, but is set in my home country. What language should I use for the dialogue?
Running a subshell from the middle of the current command
Potentiometer like component
Can someone explain this Mudra being done by Ramakrishna Paramhansa in Samadhi?
Is going from continuous data to categorical always wrong?
Is King K. Rool's down throw to up-special a true combo?
Is it ok to include an epilogue dedicated to colleagues who passed away in the end of the manuscript?
Why don't MCU characters ever seem to have language issues?
Can "semicircle" be used to refer to a part-circle that is not a exact half-circle?
Making a sword in the stone, in a medieval world without magic
Are there situations where a child is permitted to refer to their parent by their first name?
Is it illegal in Germany to take sick leave if you caused your own illness with food?
validation vs test vs training accuracy, which one to compare for claiming overfit?
How to deal with a cynical class?
Confusion with the nameplate of an induction motor
Replacing Windows 7 security updates with anti-virus?
How does Dispel Magic work against Stoneskin?
Should QA ask requirements to developers?
Good allowance savings plan?
If the Captain's screens are out, does he switch seats with the co-pilot?
When were linguistics departments first established
Haproxy process cannot restart or be killed
Apache2/fastcgi/php fastcgi/haproxy - graceful restart problems changing configuration settingsHAProxy being killed with more that 54,000 connectionscould not bind socket while haproxy restartHaproxy needs restart every 2 hoursA deeper understanding of init.d - what can they call? what's the environment?Running arbitrary program as daemon from init scriptSpamassassin Systemd ErrorCannot bind port on haproxyhaproxy process not releasing memoryFailed to find Linux Kernel Module
Running Haproxy 1.9.4
on Ubuntu 14.04
, and use an init.d
script to manage the process and auto-start at system boot. The auto-start part works fine.
For some reason, system haproxy restart
and system haproxy stop
do not affect the process at all as the process just keeps running. I attach the init.d
script as below
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
PIDFILE=/var/run/haproxy.pid
CONFIG=/etc/haproxy/haproxy.cfg
HAPROXY=/usr/local/sbin/haproxy
EXTRAOPTS=
ENABLED=1
test -x $HAPROXY || exit 0
test -f "$CONFIG" || exit 0
#if [ -e /etc/default/haproxy ]; then
# . /etc/default/haproxy
#fi
test "$ENABLED" != "0" || exit 0
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions
haproxy_start()
{
start-stop-daemon --start --pidfile "$PIDFILE"
--exec $HAPROXY -- -f "$CONFIG" -p "$PIDFILE"
$EXTRAOPTS || return 2
return 0
}
haproxy_stop()
{
if [ ! -f $PIDFILE ] ; then
# This is a success according to LSB
return 0
fi
for pid in $(cat $PIDFILE) ; do
/bin/kill $pid || return 4
done
rm -f $PIDFILE
return 0
}
haproxy_reload()
{
$HAPROXY -f "$CONFIG" -p $PIDFILE $EXTRAOPTS -sf $(cat $PIDFILE)
|| return 2
return 0
}
haproxy_checkconf()
{
rcode=0
$HAPROXY -c -f "$CONFIG"
if [ $? -ne 0 ]; then
rcode=1
fi
return $rcode
}
haproxy_status()
{
if [ ! -f $PIDFILE ] ; then
# program not running
return 3
fi
for pid in $(cat $PIDFILE) ; do
if ! ps --no-headers p "$pid" | grep haproxy > /dev/null ; then
# program running, bogus pidfile
return 1
fi
done
return 0
}
case "$1" in
checkconf)
haproxy_checkconf
exit $?
;;
start)
log_daemon_msg "Starting haproxy" "haproxy"
haproxy_start
ret=$?
case "$ret" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
echo "pid file '$PIDFILE' found, haproxy not started."
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
stop)
log_daemon_msg "Stopping haproxy" "haproxy"
haproxy_stop
ret=$?
case "$ret" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
reload|force-reload)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Reloading haproxy" "haproxy"
haproxy_reload
case "$?" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
;;
restart)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Restarting haproxy" "haproxy"
haproxy_stop
haproxy_start
case "$?" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
;;
2)
log_end_msg 1
;;
esac
;;
status)
haproxy_status
ret=$?
case "$ret" in
0)
echo "haproxy is running."
;;
1)
echo "haproxy dead, but $PIDFILE exists."
;;
*)
echo "haproxy not running."
;;
esac
exit $ret
;;
*)
echo "Usage: /etc/init.d/haproxy {start|stop|reload|restart|status|checkconf}"
exit 2
;;
esac
;
Even more strangely, can't even kill off the process by sending SIGTERM or SIGSTOP in htop
. Any idea why?
haproxy systemd init.d
add a comment |
Running Haproxy 1.9.4
on Ubuntu 14.04
, and use an init.d
script to manage the process and auto-start at system boot. The auto-start part works fine.
For some reason, system haproxy restart
and system haproxy stop
do not affect the process at all as the process just keeps running. I attach the init.d
script as below
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
PIDFILE=/var/run/haproxy.pid
CONFIG=/etc/haproxy/haproxy.cfg
HAPROXY=/usr/local/sbin/haproxy
EXTRAOPTS=
ENABLED=1
test -x $HAPROXY || exit 0
test -f "$CONFIG" || exit 0
#if [ -e /etc/default/haproxy ]; then
# . /etc/default/haproxy
#fi
test "$ENABLED" != "0" || exit 0
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions
haproxy_start()
{
start-stop-daemon --start --pidfile "$PIDFILE"
--exec $HAPROXY -- -f "$CONFIG" -p "$PIDFILE"
$EXTRAOPTS || return 2
return 0
}
haproxy_stop()
{
if [ ! -f $PIDFILE ] ; then
# This is a success according to LSB
return 0
fi
for pid in $(cat $PIDFILE) ; do
/bin/kill $pid || return 4
done
rm -f $PIDFILE
return 0
}
haproxy_reload()
{
$HAPROXY -f "$CONFIG" -p $PIDFILE $EXTRAOPTS -sf $(cat $PIDFILE)
|| return 2
return 0
}
haproxy_checkconf()
{
rcode=0
$HAPROXY -c -f "$CONFIG"
if [ $? -ne 0 ]; then
rcode=1
fi
return $rcode
}
haproxy_status()
{
if [ ! -f $PIDFILE ] ; then
# program not running
return 3
fi
for pid in $(cat $PIDFILE) ; do
if ! ps --no-headers p "$pid" | grep haproxy > /dev/null ; then
# program running, bogus pidfile
return 1
fi
done
return 0
}
case "$1" in
checkconf)
haproxy_checkconf
exit $?
;;
start)
log_daemon_msg "Starting haproxy" "haproxy"
haproxy_start
ret=$?
case "$ret" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
echo "pid file '$PIDFILE' found, haproxy not started."
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
stop)
log_daemon_msg "Stopping haproxy" "haproxy"
haproxy_stop
ret=$?
case "$ret" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
reload|force-reload)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Reloading haproxy" "haproxy"
haproxy_reload
case "$?" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
;;
restart)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Restarting haproxy" "haproxy"
haproxy_stop
haproxy_start
case "$?" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
;;
2)
log_end_msg 1
;;
esac
;;
status)
haproxy_status
ret=$?
case "$ret" in
0)
echo "haproxy is running."
;;
1)
echo "haproxy dead, but $PIDFILE exists."
;;
*)
echo "haproxy not running."
;;
esac
exit $ret
;;
*)
echo "Usage: /etc/init.d/haproxy {start|stop|reload|restart|status|checkconf}"
exit 2
;;
esac
;
Even more strangely, can't even kill off the process by sending SIGTERM or SIGSTOP in htop
. Any idea why?
haproxy systemd init.d
add a comment |
Running Haproxy 1.9.4
on Ubuntu 14.04
, and use an init.d
script to manage the process and auto-start at system boot. The auto-start part works fine.
For some reason, system haproxy restart
and system haproxy stop
do not affect the process at all as the process just keeps running. I attach the init.d
script as below
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
PIDFILE=/var/run/haproxy.pid
CONFIG=/etc/haproxy/haproxy.cfg
HAPROXY=/usr/local/sbin/haproxy
EXTRAOPTS=
ENABLED=1
test -x $HAPROXY || exit 0
test -f "$CONFIG" || exit 0
#if [ -e /etc/default/haproxy ]; then
# . /etc/default/haproxy
#fi
test "$ENABLED" != "0" || exit 0
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions
haproxy_start()
{
start-stop-daemon --start --pidfile "$PIDFILE"
--exec $HAPROXY -- -f "$CONFIG" -p "$PIDFILE"
$EXTRAOPTS || return 2
return 0
}
haproxy_stop()
{
if [ ! -f $PIDFILE ] ; then
# This is a success according to LSB
return 0
fi
for pid in $(cat $PIDFILE) ; do
/bin/kill $pid || return 4
done
rm -f $PIDFILE
return 0
}
haproxy_reload()
{
$HAPROXY -f "$CONFIG" -p $PIDFILE $EXTRAOPTS -sf $(cat $PIDFILE)
|| return 2
return 0
}
haproxy_checkconf()
{
rcode=0
$HAPROXY -c -f "$CONFIG"
if [ $? -ne 0 ]; then
rcode=1
fi
return $rcode
}
haproxy_status()
{
if [ ! -f $PIDFILE ] ; then
# program not running
return 3
fi
for pid in $(cat $PIDFILE) ; do
if ! ps --no-headers p "$pid" | grep haproxy > /dev/null ; then
# program running, bogus pidfile
return 1
fi
done
return 0
}
case "$1" in
checkconf)
haproxy_checkconf
exit $?
;;
start)
log_daemon_msg "Starting haproxy" "haproxy"
haproxy_start
ret=$?
case "$ret" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
echo "pid file '$PIDFILE' found, haproxy not started."
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
stop)
log_daemon_msg "Stopping haproxy" "haproxy"
haproxy_stop
ret=$?
case "$ret" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
reload|force-reload)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Reloading haproxy" "haproxy"
haproxy_reload
case "$?" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
;;
restart)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Restarting haproxy" "haproxy"
haproxy_stop
haproxy_start
case "$?" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
;;
2)
log_end_msg 1
;;
esac
;;
status)
haproxy_status
ret=$?
case "$ret" in
0)
echo "haproxy is running."
;;
1)
echo "haproxy dead, but $PIDFILE exists."
;;
*)
echo "haproxy not running."
;;
esac
exit $ret
;;
*)
echo "Usage: /etc/init.d/haproxy {start|stop|reload|restart|status|checkconf}"
exit 2
;;
esac
;
Even more strangely, can't even kill off the process by sending SIGTERM or SIGSTOP in htop
. Any idea why?
haproxy systemd init.d
Running Haproxy 1.9.4
on Ubuntu 14.04
, and use an init.d
script to manage the process and auto-start at system boot. The auto-start part works fine.
For some reason, system haproxy restart
and system haproxy stop
do not affect the process at all as the process just keeps running. I attach the init.d
script as below
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
PIDFILE=/var/run/haproxy.pid
CONFIG=/etc/haproxy/haproxy.cfg
HAPROXY=/usr/local/sbin/haproxy
EXTRAOPTS=
ENABLED=1
test -x $HAPROXY || exit 0
test -f "$CONFIG" || exit 0
#if [ -e /etc/default/haproxy ]; then
# . /etc/default/haproxy
#fi
test "$ENABLED" != "0" || exit 0
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions
haproxy_start()
{
start-stop-daemon --start --pidfile "$PIDFILE"
--exec $HAPROXY -- -f "$CONFIG" -p "$PIDFILE"
$EXTRAOPTS || return 2
return 0
}
haproxy_stop()
{
if [ ! -f $PIDFILE ] ; then
# This is a success according to LSB
return 0
fi
for pid in $(cat $PIDFILE) ; do
/bin/kill $pid || return 4
done
rm -f $PIDFILE
return 0
}
haproxy_reload()
{
$HAPROXY -f "$CONFIG" -p $PIDFILE $EXTRAOPTS -sf $(cat $PIDFILE)
|| return 2
return 0
}
haproxy_checkconf()
{
rcode=0
$HAPROXY -c -f "$CONFIG"
if [ $? -ne 0 ]; then
rcode=1
fi
return $rcode
}
haproxy_status()
{
if [ ! -f $PIDFILE ] ; then
# program not running
return 3
fi
for pid in $(cat $PIDFILE) ; do
if ! ps --no-headers p "$pid" | grep haproxy > /dev/null ; then
# program running, bogus pidfile
return 1
fi
done
return 0
}
case "$1" in
checkconf)
haproxy_checkconf
exit $?
;;
start)
log_daemon_msg "Starting haproxy" "haproxy"
haproxy_start
ret=$?
case "$ret" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
echo "pid file '$PIDFILE' found, haproxy not started."
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
stop)
log_daemon_msg "Stopping haproxy" "haproxy"
haproxy_stop
ret=$?
case "$ret" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
exit $ret
;;
reload|force-reload)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Reloading haproxy" "haproxy"
haproxy_reload
case "$?" in
0|1)
log_end_msg 0
;;
2)
log_end_msg 1
;;
esac
;;
restart)
echo "Checking HAProxy configuration first"
haproxy_checkconf
case "$?" in
0)
echo "Everything looks fine"
;;
1)
echo "Errors..."
exit 1
;;
esac
log_daemon_msg "Restarting haproxy" "haproxy"
haproxy_stop
haproxy_start
case "$?" in
0)
log_end_msg 0
;;
1)
log_end_msg 1
;;
2)
log_end_msg 1
;;
esac
;;
status)
haproxy_status
ret=$?
case "$ret" in
0)
echo "haproxy is running."
;;
1)
echo "haproxy dead, but $PIDFILE exists."
;;
*)
echo "haproxy not running."
;;
esac
exit $ret
;;
*)
echo "Usage: /etc/init.d/haproxy {start|stop|reload|restart|status|checkconf}"
exit 2
;;
esac
;
Even more strangely, can't even kill off the process by sending SIGTERM or SIGSTOP in htop
. Any idea why?
haproxy systemd init.d
haproxy systemd init.d
asked 4 mins ago
skyorkskyork
1154
1154
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f958175%2fhaproxy-process-cannot-restart-or-be-killed%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f958175%2fhaproxy-process-cannot-restart-or-be-killed%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown