in reply to detacher.pl

Slightly simpler is to use Proc::Daemon.

use Proc::Daemon; Proc::Daemon::Init; exec @ARGV;
Or ...
perl -MProc::Daemon -e 'Proc::Daemon::Init; exec @ARGV' some command h +ere
The difference is that this will start a new session, making it pretty much impossible that the background process will gain access to any terminal.

I'm sure someone could golf this down further, but I'm just trying to get simpler, not smaller. :-)

Replies are listed 'Best First'.
Re^2: detacher.pl
by enemyofthestate (Monk) on Apr 29, 2005 at 14:01 UTC
    Thanks. I'll take a look at that.

    Simple is good...