Jump to content

Talk:Run as a daemon or service: Difference between revisions

no edit summary
No edit summary
Line 80:
:: ok, this needs clearing up: the daemon should not write to the stdout that is connected to the terminal it was started from. it may write to stdout if that has been redirected to a file, by means that are either within the daemon itself or in a separate helper program written in the same language.
:: the part with not caring was supposed to refer to functions or libraries used within the daemon which constitute the useful part, not the daemonizing part. that is, it should be possible to take an existing program, and turn it into a daemon without having to replace all references of say <code>printf(...)</code> with <code>fprintf(somefile,...)</code>--[[User:EMBee|eMBee]] 09:10, 18 November 2011 (UTC)
::: And, of course, the shell script approach supports all of this. Redirect to /dev/null means those printf references do not have to be changed and, if stdout is redirected within the program, their output will be redirected appropriately. --[[User:Rdm|Rdm]] 18:56, 18 November 2011 (UTC)
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.