From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/209 Path: main.gmane.org!not-for-mail From: "clemens fischer" Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: runit pblms on Mandrake Date: 23 Jul 2003 20:30:52 +0200 Message-ID: References: <20030722213115.48874.qmail@web14405.mail.yahoo.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1058984989 24830 80.91.224.249 (23 Jul 2003 18:29:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Jul 2003 18:29:49 +0000 (UTC) Cc: supervision@list.skarnet.org Original-X-From: supervision-return-447-gcsg-supervision=m.gmane.org@list.skarnet.org Wed Jul 23 20:29:41 2003 Return-path: Original-Received: from antah.skarnet.org ([212.43.221.114]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 19fOMv-0006Rl-00 for ; Wed, 23 Jul 2003 20:29:41 +0200 Original-Received: (qmail 11297 invoked by uid 76); 23 Jul 2003 18:31:16 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 11291 invoked from network); 23 Jul 2003 18:31:16 -0000 Original-To: "Karthik M" In-Reply-To: <20030722213115.48874.qmail@web14405.mail.yahoo.com> (Karthik M.'s message of "Tue, 22 Jul 2003 14:31:15 -0700 (PDT)") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (berkeley-unix) Xref: main.gmane.org gmane.comp.sysutils.supervision.general:209 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:209 * Karthik M.: > That's very interesting to know that some of the getty like program > do invoke setsid() internally and some of them don't. This should be > made standardised that all of these programs should invoke setsid() > internally. this might not be a good idea. no session is needed in case getty(8) fails, but see below. > "How does the init process know that a getty process has died and it > needs to be respawned ??" it gets a signal (SIGCHLD?), it's as simple as that. i just browsed the sources of init(8), getty(8) and login(1) to find out how freebsd does it. init(8) calls getty(8), this calls login(1), and contained therein is a call to setlogin(2), which requires setsid(2) before it is called. so init(8) fork(2)s and its children do a login_tty(3) call, which does the setsid(2). a NOTES file in inits source directory has this to say (chapter numbers refer to POSIX.1): ,---- | On setsid(): | ----------- | | It appears that neither getty nor login call setsid(), so init must | do this -- seems reasonable. B.4.3.2 p 248 implies that this is the | way that 'init' should work; it says that setsid() should be called | after forking. | | Process group leaders cannot call setsid() -- another reason to | fork! Of course setsid() causes the current process to become a | process group leader, so we can only call setsid() once. Note that | the controlling terminal acquires the session leader's process | group when opened. `---- clemens