From owner-svn-src-head@freebsd.org Fri Jun 10 21:46:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF235AEF601; Fri, 10 Jun 2016 21:46:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AA15A2C7C; Fri, 10 Jun 2016 21:46:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 6BC85358C5A; Fri, 10 Jun 2016 23:46:00 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 4AAEC28494; Fri, 10 Jun 2016 23:46:00 +0200 (CEST) Date: Fri, 10 Jun 2016 23:46:00 +0200 From: Jilles Tjoelker To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl Message-ID: <20160610214600.GA87900@stack.nl> References: <201606080203.u5823rbD075793@repo.freebsd.org> <20160610144728.GA85730@stack.nl> <20160610191745.GA18133@jarvis> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160610191745.GA18133@jarvis> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 21:46:04 -0000 On Fri, Jun 10, 2016 at 09:17:45PM +0200, Mariusz Zaborski wrote: > On Fri, Jun 10, 2016 at 04:47:28PM +0200, Jilles Tjoelker wrote: > > On Wed, Jun 08, 2016 at 02:03:53AM +0000, Mariusz Zaborski wrote: > > > + if (setsid() == -1) > > > + errx(1, "Unable to detach from session"); > > There is an implicit assumption here that stdnull() is only called from > > a process that was forked off from here, since setsid() will not and > > cannot work when called from a process that is already a session leader. > > If the application is running from a shell, this setsid() will exclude > > the process from most signals, including terminal ^C/^\/^Z, kill % and > > hangups. More generally, this might make it more likely for the process > > to hang around indefinitely after the parent is gone. > I'm not sure but if the process descriptor not solve that? > If we close all process descriptor to the process it should die then, so you > need to kill just the process which is using service. Oh, right. For termination this is probably even better since terminating properly may require casper daemons, and for stopping it probably doesn't matter much. For opening files in utilities called from an interactive shell it is probably still bad since it breaks /dev/tty and obscures blocking opens such as fifos. -- Jilles Tjoelker