From owner-freebsd-questions Mon Jan 15 23:39:12 2001 Delivered-To: freebsd-questions@freebsd.org Received: from kraeusen.nbrewer.com (unknown [208.42.68.65]) by hub.freebsd.org (Postfix) with ESMTP id 167F837B400 for ; Mon, 15 Jan 2001 23:38:55 -0800 (PST) Received: by kraeusen.nbrewer.com (Postfix, from userid 1001) id 4629F1743E; Tue, 16 Jan 2001 01:38:54 -0600 (CST) Date: Tue, 16 Jan 2001 01:38:54 -0600 From: Christopher Farley To: Cliff Sarginson Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Detatch process from terminal? Message-ID: <20010116013854.D31629@northernbrewer.com> Mail-Followup-To: Christopher Farley , Cliff Sarginson , freebsd-questions@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from cliff@raggedclown.net on Tue, Jan 16, 2001 at 07:26:34AM +0000 Organization: Northern Brewer, St. Paul, MN Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Cliff Sarginson (cliff@raggedclown.net) wrote: > > 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. > > Why on earth would you want to do this with vi ? Near to useless I would > think ! Sorry, vim -g launches the GUI version of vim. Admittedly, I prefer the terminal version, but to call it useless is perhaps extreme! ;) > > Is there a shell command that will cause init to fork the new process > > instead of the shell? > > You are misunderstaning a few things here. Init inherits processes whose > parent process dies, or who detach themselves from the parent, this > can be done explicitly in the program code. There is almost certainly > a wrapper that will cause this to happen .. it's name I do not know. Running > a program nohup in the background from your login shell and logging out > will work a treat ! I know the daemon() function call does this in C, but yes... I am wondering if there is a wrapper that can be called from a shell command... perhaps part of the base system? (OPTIONAL EXPLANATION: At my workplace I need to recieve Windows PopUp messages, so I run LinPopUp; I normally run it when my X session starts, but because LinPopUp is not designed as a daemon, I occasionally [accidentally] close the window and the process dies. I would like to re-start it from the command line, and prevent it from dying if I later close the XTerm from which it was launched.) -- Christopher Farley Northern Brewer / 1150 Grand Avenue / St. Paul, MN 55105 www.northernbrewer.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message