From owner-freebsd-questions Mon Jan 15 23:48:54 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailhost01.reflexnet.net (mailhost01.reflexnet.net [64.6.192.82]) by hub.freebsd.org (Postfix) with ESMTP id 3CD8637B402 for ; Mon, 15 Jan 2001 23:48:36 -0800 (PST) Received: from rfx-64-6-211-149.users.reflexcom.com ([64.6.211.149]) by mailhost01.reflexnet.net with Microsoft SMTPSVC(5.5.1877.197.19); Mon, 15 Jan 2001 23:46:51 -0800 Received: (from cjc@localhost) by rfx-64-6-211-149.users.reflexcom.com (8.11.1/8.11.0) id f0G7mPf51892; Mon, 15 Jan 2001 23:48:25 -0800 (PST) (envelope-from cjc) Date: Mon, 15 Jan 2001 23:48:20 -0800 From: "Crist J. Clark" To: Christopher Farley Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Detatch process from terminal? Message-ID: <20010115234820.M97980@rfx-64-6-211-149.users.reflexco> Reply-To: cjclark@alum.mit.edu References: <20010116005127.A31629@northernbrewer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20010116005127.A31629@northernbrewer.com>; from chris@northernbrewer.com on Tue, Jan 16, 2001 at 12:51:27AM -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Jan 16, 2001 at 12:51:27AM -0600, Christopher Farley wrote: > Hopefully a simple question: > > Some processes can be launched from an shell, such as vim (and I presume > emacs) so that PID 1 (init) is the parent of the process, and not the > shell that launches it. > > Is there a shell command that will cause init to fork the new process > instead of the shell? $ cat daemon.sh #!/bin/sh sleep 600 & kill $$ $ sh daemon.sh Terminated $ ps axj | egrep '(^USER|sleep)' USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND cjc 51858 1 51857 c04580 0 S p3 0:00.00 sleep 600 -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message