{"action":"closed","issue":{"url":"https://api.github.com/repos/Supervisor/supervisor/issues/252","labels_url":"https://api.github.com/repos/Supervisor/supervisor/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/Supervisor/supervisor/issues/252/comments","events_url":"https://api.github.com/repos/Supervisor/supervisor/issues/252/events","html_url":"https://github.com/Supervisor/supervisor/issues/252","id":16235336,"number":252,"title":"Not receiving PROCESS_STATE_RUNNING for all processes","user":{"login":"swinton","id":27806,"avatar_url":"https://avatars.githubusercontent.com/u/27806?v=3","gravatar_id":"","url":"https://api.github.com/users/swinton","html_url":"https://github.com/swinton","followers_url":"https://api.github.com/users/swinton/followers","following_url":"https://api.github.com/users/swinton/following{/other_user}","gists_url":"https://api.github.com/users/swinton/gists{/gist_id}","starred_url":"https://api.github.com/users/swinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swinton/subscriptions","organizations_url":"https://api.github.com/users/swinton/orgs","repos_url":"https://api.github.com/users/swinton/repos","events_url":"https://api.github.com/users/swinton/events{/privacy}","received_events_url":"https://api.github.com/users/swinton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Supervisor/supervisor/labels/bug","name":"bug","color":"e10c02"},{"url":"https://api.github.com/repos/Supervisor/supervisor/labels/events","name":"events","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-07-01T21:05:32Z","updated_at":"2015-06-14T01:00:08Z","closed_at":"2015-06-14T01:00:08Z","body":"I have an event listener, defined as follows in `processlistener.py`:\r\n\r\n\r\n```python\r\nimport sys\r\n\r\nfrom supervisor.childutils import listener\r\n\r\ndef write_stdout(s):\r\n    sys.stdout.write(s)\r\n    sys.stdout.flush()\r\n\r\n\r\ndef write_stderr(s):\r\n    sys.stderr.write(s)\r\n    sys.stderr.flush()\r\n\r\n\r\ndef main():\r\n    while True:\r\n        headers, body = listener.wait(sys.stdin, sys.stdout)\r\n        body = dict([pair.split(\":\") for pair in body.split(\" \")])\r\n\r\n        write_stderr(\"Headers: %r\\n\" % repr(headers))\r\n        write_stderr(\"Body: %r\\n\" % repr(body))\r\n\r\n        if headers[\"eventname\"] == \"PROCESS_STATE_RUNNING\":\r\n            write_stderr(\"Process state running...\\n\")\r\n\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n```\r\n\r\nIn my `supervisord.conf`, I have:\r\n\r\n```\r\n[program:theprogramname]\r\ncommand=/bin/cat              ; the program (relative uses PATH, can take args)\r\nprocess_name=%(program_name)s_%(process_num)s ; process_name expr (default %(program_name)s)\r\nnumprocs=1                    ; number of processes copies to start (def 1)\r\n\r\n[eventlistener:theeventlistenername]\r\ncommand=python processlistener.py    ; the program (relative uses PATH, can take args)\r\nprocess_name=%(program_name)s_%(process_num)s       ; process_name expr (default %(program_name)s)\r\nnumprocs=1                           ; number of processes copies to start (def 1)\r\nevents=PROCESS_STATE_RUNNING         ; event notif. types to subscribe to (req'd)\r\n```\r\n\r\nWith this configuration, I am expecting my event listener to be notified whenever a process managed by Supervisor enters the `RUNNING` state. However, this is not the case. When I kill `theprogramname` with a `SIGINT` signal, the process is restarted by Supervisor, but my listener doesn't get notified of this.\r\n\r\nI've noticed though, that the listener does get notified for `PROCESS_STATE_EXITED` events.\r\n"}}