From owner-freebsd-arch@FreeBSD.ORG Mon Aug 5 11:54:25 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B9EDB575 for ; Mon, 5 Aug 2013 11:54:25 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ea0-x22f.google.com (mail-ea0-x22f.google.com [IPv6:2a00:1450:4013:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C59B2925 for ; Mon, 5 Aug 2013 11:54:25 +0000 (UTC) Received: by mail-ea0-f175.google.com with SMTP id m14so1549266eaj.20 for ; Mon, 05 Aug 2013 04:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=3O7QO2VxPpyqJCQnvabLY8nRhpYX7SQsB1CEOgNQrcw=; b=LBrwEmt6EjjlQP3SHIndI8O7bwXm9x2tYfdC/fsaK1VrqO1yBgIVMzKBQ6okyBzN67 U7LUnPfPOjZST/SOCUAKWKCr9IVIQu4id3arlf7PXxJexL5hYWHcd8XqvVkqoj3ACCzy w+TmETkg1uaVeuNVC/oURbEAGTz4PWwy/36qfkInoUePkSez8kXAm/b4u2/lylREhjhu BTSHoyBQHcBXIm1M0pNwHiwASEGnOXRoPst3xA0evMufRY3AowFkuWqBQYOvWLtNgMbu vH7WurfMGIHFsxn095bEKTNZj8k5po+PLq6qbinrEKhAezFE9jvjO6DDg00QEoKeNm78 blRg== X-Received: by 10.14.110.9 with SMTP id t9mr16817491eeg.115.1375703663661; Mon, 05 Aug 2013 04:54:23 -0700 (PDT) Received: from [192.168.1.4] (aac168.neoplus.adsl.tpnet.pl. [83.25.2.168]) by mx.google.com with ESMTPSA id k3sm32755249een.16.2013.08.05.04.54.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Aug 2013 04:54:22 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Content-Type: text/plain; charset=iso-8859-2 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Reliable process tracking From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: Date: Mon, 5 Aug 2013 13:54:20 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <014C9BBF-E651-48B9-9F42-7849BE292B5A@FreeBSD.org> References: <20130804134658.GC35080@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1508) Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Aug 2013 11:54:25 -0000 Wiadomo=B6=E6 napisana przez Edward Tomasz Napiera=B3a = w dniu 5 sie 2013, o godz. 13:13: > Wiadomo=B6=E6 napisana przez Jilles Tjoelker w dniu = 4 sie 2013, o godz. 15:46: >> When shutting down a service or requesting status, rc.subr currently >> uses a combination of pidfiles and process names. This is fairly but = not >> completely reliable once it is set up correctly (which can take a lot = of >> work and possibly patching the daemon to use pidfile(3) from our >> libutil). It is also incapable of killing multiprocess daemons such = as >> CGI web servers without cooperation of the daemon. >>=20 >> I think what is needed here is a facility that marks a process and = all >> of its descendants. Removing the mark should be a privileged or at = least >> an unusual operation; no unprivileged function specified by POSIX = such >> as setsid() should do this. >=20 > I've actually thought about that when I added setloginclass(2). It's = trivial > to modify rc.subr to use su(8) to set login class for each service. = It should > be trivial to modify pkill(1) and killall(1) to add "-c" option to = kill all processes > in a given login class And here is the patch: http://people.freebsd.org/~trasz/pkill-c.diff