{"action":"created","issue":{"url":"https://api.github.com/repos/theforeman/smart-proxy/issues/311","labels_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/311/labels{/name}","comments_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/311/comments","events_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/311/events","html_url":"https://github.com/theforeman/smart-proxy/pull/311","id":100314366,"number":311,"title":"Fixes #11323 - fixed PID writing, interrupt trap and daemon logging","user":{"login":"lzap","id":49752,"avatar_url":"https://avatars.githubusercontent.com/u/49752?v=3","gravatar_id":"","url":"https://api.github.com/users/lzap","html_url":"https://github.com/lzap","followers_url":"https://api.github.com/users/lzap/followers","following_url":"https://api.github.com/users/lzap/following{/other_user}","gists_url":"https://api.github.com/users/lzap/gists{/gist_id}","starred_url":"https://api.github.com/users/lzap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzap/subscriptions","organizations_url":"https://api.github.com/users/lzap/orgs","repos_url":"https://api.github.com/users/lzap/repos","events_url":"https://api.github.com/users/lzap/events{/privacy}","received_events_url":"https://api.github.com/users/lzap/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/theforeman/smart-proxy/labels/Needs%20re-review","name":"Needs re-review","color":"0052cc"},{"url":"https://api.github.com/repos/theforeman/smart-proxy/labels/Needs%20testing","name":"Needs testing","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-11T13:47:09Z","updated_at":"2015-08-24T15:19:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/311","html_url":"https://github.com/theforeman/smart-proxy/pull/311","diff_url":"https://github.com/theforeman/smart-proxy/pull/311.diff","patch_url":"https://github.com/theforeman/smart-proxy/pull/311.patch"},"body":"Currently, our deamonizing works as follows:\n\n- initialize configuration, logger and plugins\n- create http/https rack servers\n- daemonize the main process\n- start rack servers in own threads (each writes own pid file into same file)\n- wait five seconds\n- override interrupt signal trap\n- wait for both threads to finish\n\nProblems:\n\n- Rack writes main process pid twice (the main process should do this on its\n  own)\n- pid file is written way too long after the main process exited (this is\n  causing irregular warnings with systemd \"not readable (yet?) after start\")\n- we should get rid of the 5 seconds sleep (what is this needed for)?\n- when logging is setup to STDOUT it does not work with daemon setting (these\n  are actually exclusive, we fail out in that case)\n\nThis patch corrects PID writing, shortens the window between parent process\nfork and PID creation, removes the useless 5 second sleep / install trap and\nintroduces new setting \"SYSLOG\" which can be used in daemonized mode instead of\nSTDOUT (used in Discovery Image with journald)."},"comment":{"url":"https://api.github.com/repos/theforeman/smart-proxy/issues/comments/134245783","html_url":"https://github.com/theforeman/smart-proxy/pull/311#issuecomment-134245783","issue_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/311","id":134245783,"user":{"login":"witlessbird","id":8957,"avatar_url":"https://avatars.githubusercontent.com/u/8957?v=3","gravatar_id":"","url":"https://api.github.com/users/witlessbird","html_url":"https://github.com/witlessbird","followers_url":"https://api.github.com/users/witlessbird/followers","following_url":"https://api.github.com/users/witlessbird/following{/other_user}","gists_url":"https://api.github.com/users/witlessbird/gists{/gist_id}","starred_url":"https://api.github.com/users/witlessbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witlessbird/subscriptions","organizations_url":"https://api.github.com/users/witlessbird/orgs","repos_url":"https://api.github.com/users/witlessbird/repos","events_url":"https://api.github.com/users/witlessbird/events{/privacy}","received_events_url":"https://api.github.com/users/witlessbird/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T15:19:13Z","updated_at":"2015-08-24T15:19:13Z","body":"Looks good; I'd love to see tests for `Proxy#pid_status`, `Proxy#check_pid`, and `Proxy#write_pid` methods."}}