From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R4wNJ-0000bj-6m for garchives@archives.gentoo.org; Sat, 17 Sep 2011 15:00:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26A4121C1BF; Sat, 17 Sep 2011 15:00:04 +0000 (UTC) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by pigeon.gentoo.org (Postfix) with ESMTP id C1B7421C044 for ; Sat, 17 Sep 2011 14:59:10 +0000 (UTC) Received: by wyg36 with SMTP id 36so4467366wyg.12 for ; Sat, 17 Sep 2011 07:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=1ATehkkcE8CrcSrIGZipdBodZMWP79d2KJU8Oc/kBBg=; b=p5BOj/kqHqYozAQO9aXSqeSKz7szqDffPOW1HI4XAh4ietkUUQJM5zriXU0eBW5GO5 cKdSPBJJ2+gMHP8xQb0jXmrF5d7PaoYggn+RiBWJjt4cOZzI7KhaaO9Mi5nb28LAMTyC yyvmWrSee0lP5zzeRvlgo6KNy9CZ3kwUSapys= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.216.172.69 with SMTP id s47mr634935wel.95.1316271549781; Sat, 17 Sep 2011 07:59:09 -0700 (PDT) Received: by 10.216.38.140 with HTTP; Sat, 17 Sep 2011 07:59:09 -0700 (PDT) In-Reply-To: <1971616.Ha8JFVu6ln@eve> References: <20110912150248.GB3599@acm.acm> <1495175.Z7uWjMfsve@eve> <1971616.Ha8JFVu6ln@eve> Date: Sat, 17 Sep 2011 10:59:09 -0400 Message-ID: Subject: Re: [gentoo-user] udev + /usr From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 594c97f9106e6870b17330483869d3e4 On Sat, Sep 17, 2011 at 3:04 AM, Joost Roeleveld wrote= : > On Saturday, September 17, 2011 08:45:15 AM Joost Roeleveld wrote: >> On Friday, September 16, 2011 10:53:47 AM Canek Pel=C3=A1ez Vald=C3=A9s = wrote: >> > I think systemd gives you that in servers. With OpenRC and Apache with >> > user CGI scripts, =C2=BFdo you know how to list the httpd daemon spawn= ed >> > processes, and only those? Remember that a CGI script can double fork. >> > >> > With systemd is a matter of: >> > >> > systemctl status apache-httpd.service >> >> Did you look at the output of pstree? >> Try "pstree -pu" and you see all the PIDs and whenever there is a "user- >> switch", it also lists the new user. >> > > Had a quick look to get a more detailed list: > > Specifically only for apache: > # pstree -pu `cat /var/run/apache2.pid` > > "/var/run/apache2.pid" gets the PID for the parent process automatically. > > With this list, I can get a more detailed picture of which process calls = which > child-process / thread and which user(s) are used for which process. Yeah, but apparently you have never had a rogue (or just poorly written) CGI script. If inside a CGI script you do a double fork, and kill the first child, the second child (the "grandchild" of apache) will get reattached to PID 1. This is the POSIX defined behaviour. But then your pstree -pu $(cat /var/run/apache2.pid) doesn't work. Again, with cgroups (and without systemd) you can handle it. But then you need to do it manually for every daemon in the system. systemd allows you to do it for you. And it will be the same with user sessions, because is (for all that matters) the same problem. Your desktop session will have its own cgroup, and every application run by the user will be a subgroup of the session group. With systemd, my slow laptop boots from GRUB2 to GDM in 15 seconds. That's almost three times better than with OpenRC. But from GDM to full started desktop (before lauching applications) it takes almost 45 seconds. If I get to shave 15 seconds of it (and I am sure it will be more) by using systemd --user, I will be a really, really happy man. Regards. --=20 Canek Pel=C3=A1ez Vald=C3=A9s Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n Universidad Nacional Aut=C3=B3noma de M=C3=A9xico