in reply to Can't daemonize because STDIN/STDOUT not detatched?

Erm.. have you tried deamonizing first, then opening the p0f command?

  • Comment on Re: Can't daemonize because STDIN/STDOUT not detatched?

Replies are listed 'Best First'.
Re^2: Can't daemonize because STDIN/STDOUT not detatched?
by macli (Beadle) on May 02, 2007 at 21:30 UTC
    Good catch, It backgrounded. what is the secret behind? I also would like to see print result from terminal
    while(<$p0f>) { print if /Linux/; }
    which standard handle I should keep open for child, STDERR or STDOUT? and How?
      I don't know what you're trying to do here. Daemonizing implies you don't have, want and use STDOUT STDIN and STDERR.

      So, either use STDOUT or don't daemonize. If you only want to run the process in the background while still polluting your STDOUT for some strange reason, just fork(), or (probably better) start the process in the background from the shell.

        I want to debug what is in the socket, and I can see from the terminal. Commented out the #    open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!"; seems get the result I want, but i am not sure if it is the right way to do :)