{"action":"created","issue":{"url":"https://api.github.com/repos/bmc/daemonize/issues/18","labels_url":"https://api.github.com/repos/bmc/daemonize/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/bmc/daemonize/issues/18/comments","events_url":"https://api.github.com/repos/bmc/daemonize/issues/18/events","html_url":"https://github.com/bmc/daemonize/issues/18","id":110223946,"number":18,"title":"CPU usage spikes to 100%","user":{"login":"ankitsharda","id":13131514,"avatar_url":"https://avatars.githubusercontent.com/u/13131514?v=3","gravatar_id":"","url":"https://api.github.com/users/ankitsharda","html_url":"https://github.com/ankitsharda","followers_url":"https://api.github.com/users/ankitsharda/followers","following_url":"https://api.github.com/users/ankitsharda/following{/other_user}","gists_url":"https://api.github.com/users/ankitsharda/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitsharda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitsharda/subscriptions","organizations_url":"https://api.github.com/users/ankitsharda/orgs","repos_url":"https://api.github.com/users/ankitsharda/repos","events_url":"https://api.github.com/users/ankitsharda/events{/privacy}","received_events_url":"https://api.github.com/users/ankitsharda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-07T13:18:28Z","updated_at":"2015-10-07T13:59:41Z","closed_at":null,"body":"I am using daemonize to covert binaries (of our own software) to daemons. I've experienced an issue where two of these binaries immediately show 100% of a core usage when they are started using daemonize. When I run them in tmux or in the foreground , they report normal CPU usage. Any ideas on what could be causing this ?\r\n\r\nAnkit"},"comment":{"url":"https://api.github.com/repos/bmc/daemonize/issues/comments/146203720","html_url":"https://github.com/bmc/daemonize/issues/18#issuecomment-146203720","issue_url":"https://api.github.com/repos/bmc/daemonize/issues/18","id":146203720,"user":{"login":"bmc","id":23894,"avatar_url":"https://avatars.githubusercontent.com/u/23894?v=3","gravatar_id":"","url":"https://api.github.com/users/bmc","html_url":"https://github.com/bmc","followers_url":"https://api.github.com/users/bmc/followers","following_url":"https://api.github.com/users/bmc/following{/other_user}","gists_url":"https://api.github.com/users/bmc/gists{/gist_id}","starred_url":"https://api.github.com/users/bmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmc/subscriptions","organizations_url":"https://api.github.com/users/bmc/orgs","repos_url":"https://api.github.com/users/bmc/repos","events_url":"https://api.github.com/users/bmc/events{/privacy}","received_events_url":"https://api.github.com/users/bmc/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T13:59:41Z","updated_at":"2015-10-07T13:59:41Z","body":"First, where are you running the code (Mac OS X, FreeBSD, Linux)? All three support a _daemon_(3) function that you can call directly from your code, instead of relying on an external tool like `daemonize`. That's a possible alternative.\r\n\r\nSecond, you can use the `-e` and `-o` options to `daemonize` to redirect `stderr` and `stdout`, respectively, to files, rather than `/dev/null`. Put some `printf` statements in your code, in addition to using `gdb`. (Attaching with a debugger will, of course, perturb the running of the program more dramatically than adding print statements will.)"}}