Run as a daemon or service: Difference between revisions

Line 323:
=={{header|Smalltalk}}==
{{works with |Smalltalk/X}}
<lang smalltalk>(pid#! :=/usr/bin/env OperatingSystemstx fork) == 0 ifTrue:[--script
(pid := OperatingSystem fork) == 0 ifTrue:[
Stdin close.
Stdout := '/tmp/daemon.log' asFilename writeStream.
Line 339 ⟶ 340:
]</lang>
{{out}}
<pre>bash-3.2$ ./daemon.st
<pre>forked new process pid=77897; now exiting
bash-3.2$
... after a few seconds:
bash-3.2$ cat /tmp/daemon.log
here is the child
another hello on Transcript 1
Anonymous user