haproxy init.d/systemctl issue

Hello all,
Recently (hard to say when, within the last few months) something seems to have gone wrong with the haproxy init.d script. I’m running 64bit openSUSE 12.2; the start/stop on the script works fine but reload causes it to stop essentially –

linux-91ug:/etc/init.d # /etc/init.d/haproxy start
redirecting to systemctl

linux-91ug:/etc/init.d # /etc/init.d/haproxy status
redirecting to systemctl
haproxy.service - LSB: haproxy
          Loaded: loaded (/etc/init.d/haproxy)
          Active: active (running) since Thu, 10 Jan 2013 12:35:40 +0200; 1s ago
         Process: 2902 ExecStop=/etc/init.d/haproxy stop (code=exited, status=0/SUCCESS)
         Process: 2889 ExecReload=/etc/init.d/haproxy reload (code=exited, status=0/SUCCESS)
         Process: 3025 ExecStart=/etc/init.d/haproxy start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/haproxy.service
                  â 3035 /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid


Jan 10 12:35:40 linux-91ug haproxy[3025]: Starting haproxy ..done

linux-91ug:/etc/init.d # /etc/init.d/haproxy reload
redirecting to systemctl

linux-91ug:/etc/init.d # /etc/init.d/haproxy status
redirecting to systemctl
haproxy.service - LSB: haproxy
          Loaded: loaded (/etc/init.d/haproxy)
          Active: inactive (dead) since Thu, 10 Jan 2013 12:35:43 +0200; 1s ago
         Process: 3055 ExecStop=/etc/init.d/haproxy stop (code=exited, status=0/SUCCESS)
         Process: 3043 ExecReload=/etc/init.d/haproxy reload (code=exited, status=0/SUCCESS)
         Process: 3025 ExecStart=/etc/init.d/haproxy start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/haproxy.service


Jan 10 12:35:40 linux-91ug haproxy[3025]: Starting haproxy ..done
Jan 10 12:35:43 linux-91ug haproxy[3043]: Reload service haproxy ..done
Jan 10 12:35:43 linux-91ug haproxy[3055]: Shutting down haproxy ..done

linux-91ug:/etc/init.d # ps ax|grep haproxy
 3080 pts/0    S+     0:00 grep --color=auto haproxy



As you can see a reload kills the task. Am I missing something?

Just to be clear if I take what it should run out of init.d/haproxy and run it myself it works fine - something like this: haproxy -p /var/run/haproxy.pid -D -f /etc/haproxy/haproxy.cfg -sf 4238

I have some more information - what is the difference between running ./haproxy xxxx in init.d and running /etc/init.d/haproxy xxxx ? Because there seems to be a significant difference and if I use ./haproxy reload it works fine; /etc/init.d/haproxy reload does not.

linux-ixjs:/etc/init.d # ./haproxy status
redirecting to systemctl
Checking for service haproxy                                                                                                                                                            dead
linux-ixjs:/etc/init.d # /etc/init.d/haproxy status
redirecting to systemctl
haproxy.service - LSB: haproxy XYZ daemon providing ZYX
          Loaded: loaded (/etc/init.d/haproxy)
          Active: active (exited) since Wed, 16 Jan 2013 10:14:16 +0200; 8min ago
          CGroup: name=systemd:/system/haproxy.service


Jan 16 10:14:16 linux-ixjs haproxy[2231]: Starting haproxy ..done
Jan 16 10:14:30 linux-ixjs haproxy[2351]: Reload service haproxy ..done
Jan 16 10:19:12 linux-ixjs haproxy[2939]: Reload service haproxy ..done
Jan 16 10:19:38 linux-ixjs haproxy[3032]: Reload service haproxy ..done



We have same issue - haproxy does not restart on -sf/-st.
This is not init script bug:

/usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)

doesn’t working the way described in manual.

I’ll mail to Willy.

Although I am not running haproxy, based on some systemd stuff I’ve been reading lately, the /etc/…/haproxy might be your custom configuration whereas simply ./haproxy may be the generic command.

In any case, it looks like the systemd haproxy unit has been written and your init commands are simply re-directing to the systemd unit. You might do at least better to invoke the haproxy unit directly instead, try these


# systemctl start|stop|reload|enable|disable|status haproxy.service

I don’t know if init reload behavior is different than systemd, reload will update with any config changes but does not by itself restart or start the service (unit).

HTH,
TSU