From owner-freebsd-questions Wed Sep 6 16:47:22 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.freebsd.org (8.6.11/8.6.6) id QAA28330 for questions-outgoing; Wed, 6 Sep 1995 16:47:22 -0700 Received: from vellocet.insync.net (vellocet.insync.net [204.253.208.10]) by freefall.freebsd.org (8.6.11/8.6.6) with ESMTP id QAA28324 for ; Wed, 6 Sep 1995 16:47:21 -0700 Received: from RANDY by vellocet.insync.net (SAA00009); Wed, 6 Sep 1995 18:43:41 -0500 Date: Wed, 6 Sep 1995 18:43:41 -0500 Message-Id: <199509062343.SAA00009@vellocet.insync.net> X-Sender: rberndt@nething.com X-Mailer: Windows Eudora Version 2.1.1 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: questions@freebsd.org From: Randy Berndt Subject: setsid() saves the day... Sender: questions-owner@freebsd.org Precedence: bulk I had posted a message awhile ago about a problem getting a program to stay up when run from rc.local. It would start, then die as soon as rc.local finished. I stuck a 'ps ax' at the end of rc.local, and the process showed stat of S+ (+ evidently indicating that the process was associated with the foreground session). Hmmmmm..... 'apropos session' setsid? 'man setsid' Exactly what I was looking for! I stuck "sid = setsid();" in the first part of main, and it works great! Just thought I would pass this along. Randy Berndt ---------------------------------- AOS/VS, FreeBSD, DOS: I'm caught in a maze of twisty little command interpreters, all different.