{"action":"created","issue":{"url":"https://api.github.com/repos/Supervisor/supervisor/issues/622","labels_url":"https://api.github.com/repos/Supervisor/supervisor/issues/622/labels{/name}","comments_url":"https://api.github.com/repos/Supervisor/supervisor/issues/622/comments","events_url":"https://api.github.com/repos/Supervisor/supervisor/issues/622/events","html_url":"https://github.com/Supervisor/supervisor/issues/622","id":83298389,"number":622,"title":"Cannot receive a event notification","user":{"login":"detailyang","id":3370345,"avatar_url":"https://avatars.githubusercontent.com/u/3370345?v=3","gravatar_id":"","url":"https://api.github.com/users/detailyang","html_url":"https://github.com/detailyang","followers_url":"https://api.github.com/users/detailyang/followers","following_url":"https://api.github.com/users/detailyang/following{/other_user}","gists_url":"https://api.github.com/users/detailyang/gists{/gist_id}","starred_url":"https://api.github.com/users/detailyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/detailyang/subscriptions","organizations_url":"https://api.github.com/users/detailyang/orgs","repos_url":"https://api.github.com/users/detailyang/repos","events_url":"https://api.github.com/users/detailyang/events{/privacy}","received_events_url":"https://api.github.com/users/detailyang/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Supervisor/supervisor/labels/events","name":"events","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-01T03:56:52Z","updated_at":"2015-06-02T15:46:46Z","closed_at":"2015-06-02T05:48:04Z","body":"Hi, i need to receive a process state event. So i use the event listener to do this. But now i can only receive the event about the event listener self, not other process. my configure file is below:\r\n\r\n````\r\n[program:sample]\r\ndirectory=/data/\r\ncommand=/bin/bash -c 'while sleep 1; do echo \"test\"; done'\r\nredirect_stderr=true\r\nlog_stdout=true             ; if true, log program stdout (default true)\r\nlog_stderr=true             ; if true, log program stderr (def false)\r\nstdout_logfile=/data/logs/supervisord/sample.log    ; child log path, use NONE for none; default AUTO\r\nstdout_logfile_maxbytes=50MB        ; max # logfile bytes b4 rotation (default 50MB)\r\nstdout_logfile_backups=3         ; # of logfile backups (default 10)\r\n\r\n[program:cat]\r\ndirectory=/data/\r\ncommand=/bin/cat\r\nredirect_stderr=true\r\nlog_stdout=true             ; if true, log program stdout (default true)\r\nlog_stderr=true             ; if true, log program stderr (def false)\r\nstdout_logfile=/data/logs/supervisord/cat.log    ; child log path, use NONE for none; default AUTO\r\nstdout_logfile_maxbytes=50MB        ; max # logfile bytes b4 rotation (default 50MB)\r\nstdout_logfile_backups=3         ; # of logfile backups (default 10)\r\n\r\n[eventlistener:event]\r\ncommand=/opt/python/bin/python /etc/supervisord.d/event.py\r\nevents=PROCESS_STATE\r\nredirect_stderr=true\r\nlog_stdout=true             ; if true, log program stdout (default true)\r\nlog_stderr=true             ; if true, log program stderr (def false)\r\nstdout_logfile=/data/logs/supervisord/x.log    ; child log path, use NONE for none; default AUTO\r\nstdout_logfile_maxbytes=50MB        ; max # logfile bytes b4 rotation (default 50MB)\r\nstdout_logfile_backups=3         ; # of logfile backups (default 10)\r\nbuffer_size=10\r\n````\r\n\r\nmy event.py\r\n````\r\n\r\n#! /opt/python/bin/python\r\nimport sys\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\nif __name__ == '__main__':\r\n    main()\r\n````\r\n\r\nmy log\r\n````\r\n\r\nREADY\r\nHeaders: \"{'ver': '3.0', 'poolserial': '0', 'len': '60', 'server': 'supervisor', 'eventname': 'PROCESS_STATE_STARTING', 'serial': '117', 'pool': 'event'}\"\r\nBody: \"{'from_state': 'STOPPED', 'processname': 'event', 'tries': '0', 'groupname': 'event'}\"\r\nREADY\r\nREADY\r\nHeaders: \"{'ver': '3.0', 'poolserial': '0', 'len': '60', 'server': 'supervisor', 'eventname': 'PROCESS_STATE_STARTING', 'serial': '133', 'pool': 'event'}\"\r\nBody: \"{'from_state': 'STOPPED', 'processname': 'event', 'tries': '0', 'groupname': 'event'}\"\r\nREADY\r\nREADY\r\nHeaders: \"{'ver': '3.0', 'poolserial': '0', 'len': '60', 'server': 'supervisor', 'eventname': 'PROCESS_STATE_STARTING', 'serial': '145', 'pool': 'event'}\"\r\nBody: \"{'from_state': 'STOPPED', 'processname': 'event', 'tries': '0', 'groupname': 'event'}\"\r\nREADY\r\n````\r\nas you see, i cannot receive the sample process event notification, although i use the comand `supervisorctl restart sample` \r\nguys, any idea?"},"comment":{"url":"https://api.github.com/repos/Supervisor/supervisor/issues/comments/107996023","html_url":"https://github.com/Supervisor/supervisor/issues/622#issuecomment-107996023","issue_url":"https://api.github.com/repos/Supervisor/supervisor/issues/622","id":107996023,"user":{"login":"mnaberez","id":52712,"avatar_url":"https://avatars.githubusercontent.com/u/52712?v=3","gravatar_id":"","url":"https://api.github.com/users/mnaberez","html_url":"https://github.com/mnaberez","followers_url":"https://api.github.com/users/mnaberez/followers","following_url":"https://api.github.com/users/mnaberez/following{/other_user}","gists_url":"https://api.github.com/users/mnaberez/gists{/gist_id}","starred_url":"https://api.github.com/users/mnaberez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnaberez/subscriptions","organizations_url":"https://api.github.com/users/mnaberez/orgs","repos_url":"https://api.github.com/users/mnaberez/repos","events_url":"https://api.github.com/users/mnaberez/events{/privacy}","received_events_url":"https://api.github.com/users/mnaberez/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T15:46:46Z","updated_at":"2015-06-02T15:46:46Z","body":"`supervisord` will now halt with an error message if `redirect_stderr=true` is set in an `[eventlistener:x]` section.  This was committed in 4420af41f34ef183e857d372e1a22af641de3149 and will be released in Supervisor 3.2."}}