Hi Brandon,

   I don’t see any default haproxy on my VM, also I didn't find file at  
/usr/lib/systemd/system/haproxy.service. 

   I could see haproxy which I installed 1.7.2 at /etc/init.d/haproxy , 
attached the same file changing the extension. 

Thanks,
UmaMahesh

-----Original Message-----
From: Brandon Perkins [mailto:[email protected]] 
Sent: Thursday, February 09, 2017 7:43 AM
To: Gunuganti, Uma Maheshwar Rao <[email protected]>
Cc: [email protected]
Subject: Re: Haproxy reload fails on RHEL 7.2

On Wed, Feb 08, 2017 at 11:39:37PM +0000, Gunuganti, Uma Maheshwar Rao wrote:
> Date: Wed, 8 Feb 2017 23:39:37 +0000
> From: "Gunuganti, Uma Maheshwar Rao" <[email protected]>
> To: "[email protected]" <[email protected]>
> Subject: Haproxy reload fails on RHEL 7.2
> List-Id: Haproxy <[email protected]>
> Content-Type: multipart/alternative;
>  boundary="_000_CY1PR03MB2267E796DBA293868A4D82ADD3420CY1PR03MB2267namp_"
> 
> Hi,
> 
> I am using haproxy 1.7.2 version and trying to use reload option which is 
> failing in my environment with RHEL 7.2 version, same works fine in RHEL 6.8 
> version.
> 
> Please find the logs below:
> 
> Feb  8 23:38:19 localhost systemd: Reloaded SYSV: HA-Proxy is a TCP/HTTP 
> reverse proxy which is particularly suited for high availability 
> environments..
> Feb  8 23:38:19 localhost systemd: haproxy.service: main process 
> exited, code=killed, status=9/KILL Feb  8 23:38:19 localhost haproxy: 
> Shutting down haproxy: [FAILED] Feb  8 23:38:19 localhost systemd: Unit 
> haproxy.service entered failed state.
> Feb  8 23:38:19 localhost systemd: haproxy.service failed.
> 
> 
> Thanks in advance for help.
> 
> Thanks,
> UmaMahesh
> 

Could you please post your:

/usr/lib/systemd/system/haproxy.service

file.  It appears that you're running your own version of HAProxy, as RHEL 7.2 
ships with haproxy-1.5.14-3.el7 and not 1.7.2.

There are some significant differences between the upstream systemd service 
file and the one we use in Fedora and RHEL, that may indicate where the problem 
lies.

--
Thanks,
Brandon

#!/bin/sh
#
# chkconfig: - 85 15
# description: HA-Proxy is a TCP/HTTP reverse proxy which is particularly 
suited \
#              for high availability environments.
# processname: haproxy
# config: /etc/haproxy/haproxy.cfg
# pidfile: /var/run/haproxy.pid

# Script Author: Simon Matter <[email protected]>
# Version: 2004060600

# Source function library.
if [ -f /etc/init.d/functions ]; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
else
  exit 0
fi

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# This is our service name
BASENAME=`basename $0`
if [ -L $0 ]; then
  BASENAME=`find $0 -name $BASENAME -printf %l`
  BASENAME=`basename $BASENAME`
fi

BIN=/usr/sbin/$BASENAME

CFG=/etc/$BASENAME/$BASENAME.cfg
[ -f $CFG ] || exit 1

PIDFILE=/var/run/$BASENAME.pid
LOCKFILE=/var/lock/subsys/$BASENAME

RETVAL=0

start() {
  quiet_check
  if [ $? -ne 0 ]; then
    echo "Errors found in configuration file, check it with '$BASENAME check'."
    return 1
  fi

  echo -n "Starting $BASENAME: "
  daemon $BIN -D -f $CFG -p $PIDFILE
  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && touch $LOCKFILE
  return $RETVAL
}

stop() {
  echo -n "Shutting down $BASENAME: "
  killproc $BASENAME -USR1
  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
  [ $RETVAL -eq 0 ] && rm -f $PIDFILE
  return $RETVAL
}

restart() {
  quiet_check
  if [ $? -ne 0 ]; then
    echo "Errors found in configuration file, check it with '$BASENAME check'."
    return 1
  fi
  stop
  start
}

reload() {
  if ! [ -s $PIDFILE ]; then
    return 0
  fi

  quiet_check
  if [ $? -ne 0 ]; then
    echo "Errors found in configuration file, check it with '$BASENAME check'."
    return 1
  fi
  $BIN -D -f $CFG -p $PIDFILE -sf $(cat $PIDFILE)
}

check() {
  $BIN -c -q -V -f $CFG
}

quiet_check() {
  $BIN -c -q -f $CFG
}

rhstatus() {
  status $BASENAME
}

condrestart() {
  [ -e $LOCKFILE ] && restart || :
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    restart
    ;;
  reload)
    reload
    ;;
  condrestart)
    condrestart
    ;;
  status)
    rhstatus
    ;;
  check)
    check
    ;;
  *)
    echo $"Usage: $BASENAME 
{start|stop|restart|reload|condrestart|status|check}"
    exit 1
esac

exit $?

Reply via email to