{"action":"created","issue":{"url":"https://api.github.com/repos/scripting/Scripting-News/issues/74","repository_url":"https://api.github.com/repos/scripting/Scripting-News","labels_url":"https://api.github.com/repos/scripting/Scripting-News/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/scripting/Scripting-News/issues/74/comments","events_url":"https://api.github.com/repos/scripting/Scripting-News/issues/74/events","html_url":"https://github.com/scripting/Scripting-News/issues/74","id":312689495,"number":74,"title":"Question about forever","user":{"login":"scripting","id":1686843,"avatar_url":"https://avatars2.githubusercontent.com/u/1686843?v=4","gravatar_id":"","url":"https://api.github.com/users/scripting","html_url":"https://github.com/scripting","followers_url":"https://api.github.com/users/scripting/followers","following_url":"https://api.github.com/users/scripting/following{/other_user}","gists_url":"https://api.github.com/users/scripting/gists{/gist_id}","starred_url":"https://api.github.com/users/scripting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scripting/subscriptions","organizations_url":"https://api.github.com/users/scripting/orgs","repos_url":"https://api.github.com/users/scripting/repos","events_url":"https://api.github.com/users/scripting/events{/privacy}","received_events_url":"https://api.github.com/users/scripting/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-09T21:12:01Z","updated_at":"2018-04-11T14:50:24Z","closed_at":null,"author_association":"OWNER","body":"I have been playing with the source for the [forever](https://github.com/foreverjs/forever) utility. \r\n\r\nI want to try adding a few features, see what happens.\r\n\r\nBut I have a basic question.\r\n\r\nI can create an app called myforever.js.\r\n\r\nI run it like this\r\n\r\n`node myforever.js`\r\n\r\nAnd it runs.\r\n\r\nBut it runs in the foreground. \r\n\r\nI want to run it in the background, like forever does.\r\n\r\nHow?"},"comment":{"url":"https://api.github.com/repos/scripting/Scripting-News/issues/comments/380480413","html_url":"https://github.com/scripting/Scripting-News/issues/74#issuecomment-380480413","issue_url":"https://api.github.com/repos/scripting/Scripting-News/issues/74","id":380480413,"user":{"login":"emk","id":36963,"avatar_url":"https://avatars2.githubusercontent.com/u/36963?v=4","gravatar_id":"","url":"https://api.github.com/users/emk","html_url":"https://github.com/emk","followers_url":"https://api.github.com/users/emk/followers","following_url":"https://api.github.com/users/emk/following{/other_user}","gists_url":"https://api.github.com/users/emk/gists{/gist_id}","starred_url":"https://api.github.com/users/emk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emk/subscriptions","organizations_url":"https://api.github.com/users/emk/orgs","repos_url":"https://api.github.com/users/emk/repos","events_url":"https://api.github.com/users/emk/events{/privacy}","received_events_url":"https://api.github.com/users/emk/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T14:50:24Z","updated_at":"2018-04-11T14:50:24Z","author_association":"NONE","body":"It depends on the operating system and on exactly what you want.\r\n\r\n- This simplest thing is to just type `node myforever.js &`.\r\n- If you want it to keep running in the background even after closing the terminal or SSH connection, then `nohup node myforever.js &` might work.\r\n- If you want to build a \"production quality\" version, it actually gets pretty hairy. There's a [full list of steps here](https://linux.die.net/man/1/daemonize), including (1) closing stdin, stdout and stderr, (2) changing the working directory to `/`, (3) setting an appropriate `umask`, (4) calling `fork` to split off a background process, etc. You could probably leave out some of these steps.\r\n\r\nThere are [a whole bunch of node packages which claim to implement some version of this for you](https://www.npmjs.com/search?q=daemonize), but I don't know which of them would be the best choice."}}
{"actor":{"display_login":"emk"}}