Great! Now my daemon works just the way I want it to :)

  Thanks a lot to everybody for all the useful help!

//samuel

2003-12-07 kl. 14.52 skrev Reimer Behrends:
> Daemonization in seven easy steps [1]:
>
>   exit if fork                   # Parent exits, child continues.
>   Process.setsid                 # Become session leader.
>   exit if fork                   # Zap session leader. See [1].
>   Dir.chdir "/"                  # Release old working directory.
>   File.umask 0000                # Ensure sensible umask. Adjust as 
> needed.
>   STDIN.reopen "/dev/null"       # Free file descriptors and
>   STDOUT.reopen "/dev/null", "a" # point them somewhere sensible.
>   STDERR.reopen STDOUT           # STDOUT/ERR should better go to a 
> logfile.
>
> Refine as necessary.
>
> 			Reimer Behrends
>
> [1] http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
>