I have done more digging and I have discovered that the issue is in the value passed to the "command" option under the [program:yourprogramname] section of the supervisor configuration file.
The Ratchet deployment instructions suggest that we should use something like the following:
command = bash -c "ulimit -n 10000 && /usr/bin/php path/to/your/script"
That's what's causing PHP to hang and keep listening to the port. This makes is impossible to restart Ratchet from within the supervisorctl shell. It also makes it impossible for supervisor to restart you script gracefully after a crash. It will always with say that the address is already in use.
Now, try changing the command option to the following and you will see that it will work flawlessly (start ..., reread, restart all, reload, ...)
command = /usr/bin/php path/to/your/script
My analysis of the situation is that when you use bash -c "ulimit -n 10000 && /usr/bin/php path/to/your/script", then supervisor will not see PHP (and your script) has a child process to be supervised. Instead, it will see the bash command. Normally, since bash has started PHP, one might think that stopping bash should stop PHP. But I am now wondering what happens if that PHP script has the ability to fork.
The bottom line is that we should find a way to be able to run the ulimit -n 10000, without using bash as main script.
Regards
Abdoulaye Siby