I was looking into this and the upstart script was the cause; using su -c means that when the daemon is killed or restarted, only the 'su' process gets killed but the daemon itself does not, so it sits hanging on the :2181 port and then the new daemon instance can't run.
The fix I used which requires installing an the daemonize package was this change to the end of zookeeper.conf.j2:
I was looking into this and the upstart script was the cause; using su -c means that when the daemon is killed or restarted, only the 'su' process gets killed but the daemon itself does not, so it sits hanging on the :2181 port and then the new daemon instance can't run.
The fix I used which requires installing an the daemonize package was this change to the end of zookeeper.conf.j2:
Although it would require tasks/RedHat.yml to be changed to add 'daemonize' to the 'Install OS Packages' list.
I actually fixed it with my own tasks overriding the defaults.