From owner-freebsd-hackers Wed Aug 29 20: 1:31 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.morning.ru (ns.morning.ru [195.161.98.5]) by hub.freebsd.org (Postfix) with ESMTP id DBE4237B406; Wed, 29 Aug 2001 20:01:26 -0700 (PDT) (envelope-from poige@morning.ru) Received: from 217.106.131.29 ([195.161.98.250]) by ns.morning.ru (8.11.5/8.11.5) with ESMTP id f7U31MY85701; Thu, 30 Aug 2001 11:01:24 +0800 (KRAST) Date: Thu, 30 Aug 2001 11:01:32 +0800 From: Igor Podlesny X-Mailer: The Bat! (v1.52 Beta/7) UNREG / CD5BF9353B3B7091 Organization: Morning Network X-Priority: 3 (Normal) Message-ID: <792042206.20010830110132@morning.ru> To: Mike Barcroft Cc: hackers@FreeBSD.ORG, Peter da Silva Subject: Re: Proposed Utility - detach(1) In-Reply-To: <20010824141955.B64018@coffee.q9media.com> References: <20010824141955.B64018@coffee.q9media.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > I would appreciate comments on the usefulness of a utility which would > allow one to detach a process from a TTY. I imagine the utility would > be very small and just call daemon(3) and execlp(3). 1) cd /usr/ports/sysutils/detach have fun... 2) the code itself is rather simple and I wrote such detach.c by myself on FreeBSD 3.4 before I had a chance to look into ports collection. Here it is: /*========================================================== * detach.c *---------------------------------------------------------- * Executes given as arguments programs having * detached TTY at first. * * by Poige, poige@nm.ru *========================================================== */ #include #include #include int main(int argc, char **argv) { /* executes another programs having detached * tty at first */ return ! ( argv[1] && (fork () == 0) && (setsid () > 0) && (fork () == 0) && (execvp (argv[1], argv + 1) > 0) ); } > Would a utility like this be useful? yes > Is this functionality already available in a system utility? in ports... > Best regards, > Mike Barcroft -- Igor mailto:poige@morning.ru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message