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 1S8f3r-0003Wz-0s for garchives@archives.gentoo.org; Fri, 16 Mar 2012 21:51:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A43C5E0BFE; Fri, 16 Mar 2012 21:51:33 +0000 (UTC) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by pigeon.gentoo.org (Postfix) with ESMTP id BE4F5E0BA5 for ; Fri, 16 Mar 2012 21:50:23 +0000 (UTC) Received: by werm13 with SMTP id m13so5152475wer.40 for ; Fri, 16 Mar 2012 14:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=8rARoXGimY8Gh1zFQmcTYsSLblADFLHS59yBQ9ryex8=; b=fcRggM7K+SmHLyr1ga4FmZ0hnR1Nk/a7X+oD2N2mRWwTem5gzklygsJj0gOrQjy4nh ChBxpuijWcQolrClZlPJya6PjMd1IFi5ddW2YKmuLDbjT1orJdapYIKXlXPHFJf7XRZa wT0ldjZqqdXSxVXetuGzB+fswgOwULy/w9kS9pEKYEZ0FvUCQMs4h9tjCf82CZQc4ZFq t1fo402CtO0P1GU0TSHMjEY23Fc26hWVsSso1Q8bOw89qivL74y/g0jkNQEuizdqzEAU Bm4dityMBhIm6j81L0jtWQDqAtNVP8N/ZXegDH93j6aWs4PVbBnjPtSt4yGjbMGPm3IP wx4Q== 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.180.102.129 with SMTP id fo1mr1867155wib.6.1331934623028; Fri, 16 Mar 2012 14:50:23 -0700 (PDT) Received: by 10.223.8.68 with HTTP; Fri, 16 Mar 2012 14:50:22 -0700 (PDT) In-Reply-To: References: Date: Fri, 16 Mar 2012 14:50:22 -0700 Message-ID: Subject: Re: [gentoo-user] To mount or not to Mount proc, that is the question From: Mark Knecht To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 377cdc0e-d9b6-45c9-b434-b7f535fb0827 X-Archives-Hash: d113cda25a5e6351ba87f2560a33596d On Fri, Mar 16, 2012 at 2:40 PM, Canek Pel=C3=A1ez Vald=C3=A9s wrote: > On Fri, Mar 16, 2012 at 3:18 PM, Mark Knecht wrote= : >> On Fri, Mar 16, 2012 at 12:47 PM, Canek Pel=C3=A1ez Vald=C3=A9s wrote: >>> On Fri, Mar 16, 2012 at 1:40 PM, Mark Knecht wro= te: >> >>>> Looking at the Gentoo amd64 install guide here: >>>> >>>> http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3D1&chap= =3D8 >>>> >>>> it appears that the recommendation is to mount proc. >>>> >>>> [QUOTE] >>>> >>>> /dev/sda1 =C2=A0 /boot =C2=A0 =C2=A0 =C2=A0 =C2=A0ext2 =C2=A0 =C2=A0de= faults,noatime =C2=A0 =C2=A0 1 2 >>>> /dev/sda2 =C2=A0 none =C2=A0 =C2=A0 =C2=A0 =C2=A0 swap =C2=A0 =C2=A0sw= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 0 >>>> /dev/sda3 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ext3 =C2= =A0 =C2=A0noatime =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 1 >>>> >>>> /dev/cdrom =C2=A0/mnt/cdrom =C2=A0 auto =C2=A0 =C2=A0noauto,user =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 0 >>>> >>>> proc =C2=A0 =C2=A0 =C2=A0 =C2=A0/proc =C2=A0 =C2=A0 =C2=A0 =C2=A0proc = =C2=A0 =C2=A0defaults =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 0 >>>> shm =C2=A0 =C2=A0 =C2=A0 =C2=A0 /dev/shm =C2=A0 =C2=A0 tmpfs =C2=A0 no= dev,nosuid,noexec =C2=A00 0 >>>> >>>> [QUOTE] >> >>> >>> I haven't put /proc explicitly on my /etc/fstab since a long time ago, >>> and everything seems to be working. However, I use systemd, which >>> always mounts /proc with the default options, and only uses the entry >>> in /etc/fstab (if present) to override the default options. In other >>> words, systemd always mounts /proc, no matter if it's listed in >>> /etc/fstab or not. >>> >>> I don't know what OpenRC does, but it would not surprise me that it's >>> something similar. >>> >>> Regards. >>> -- >>> 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 >>> >> >> Thanks Canek. I appreciate your response. >> >> It seems when rereading the link above the authors do put the work >> 'example' in italics, implying that possibly I should know what I'm >> doing and not depend on the text on that page. I'm fine with the not >> depending part. I'm not so sure about the 'know what I'm doing' part. >> ;-) >> >> I'm going to take a wild guess that it's somehow mounted in an init >> script these days but I have no reason to know that's actually how it >> gets done. I did read the kernel docs and it doesn't seem to be done >> automatically by the kernel AFAICT. > > No, it's the init system; look at /lib/rc/sh/init.sh:66: > > # By default VServer already has /proc mounted, but OpenVZ does not! > # However, some of our users have an old proc image in /proc > # NFC how they managed that, but the end result means we have to test if > # /proc actually works or not. We do this by comparing two reads of > # /proc/self/environ for which we have set the variable VAR to two > # different values. If the comparison comes back equal, we know that > # /proc is not working. > mountproc=3Dtrue > f=3D/proc/self/environ > if [ -e $f ]; then > =C2=A0 =C2=A0 =C2=A0 =C2=A0if [ "$(VAR=3Da cat $f)" =3D "$(VAR=3Db cat $f= )" ]; then > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0eerror "You have c= ruft in /proc that should be deleted" > =C2=A0 =C2=A0 =C2=A0 =C2=A0else > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0einfo "/proc is al= ready mounted, skipping" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mountproc=3Dfalse > =C2=A0 =C2=A0 =C2=A0 =C2=A0fi > fi > unset f > > if $mountproc; then > =C2=A0 =C2=A0 =C2=A0 =C2=A0procfs=3D"proc" > =C2=A0 =C2=A0 =C2=A0 =C2=A0[ "$RC_UNAME" =3D "GNU/kFreeBSD" ] && proc=3D"= linprocfs" > =C2=A0 =C2=A0 =C2=A0 =C2=A0ebegin "Mounting /proc" > =C2=A0 =C2=A0 =C2=A0 =C2=A0if ! fstabinfo --mount /proc; then > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mount -n -t "$proc= fs" -o noexec,nosuid,nodev proc /proc > =C2=A0 =C2=A0 =C2=A0 =C2=A0fi > =C2=A0 =C2=A0 =C2=A0 =C2=A0eend $? > fi > > Mistery solved :D > > Regards. > -- > 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 > Yep, that's it. Somewhat interestingly it was at line 89 in my file but that may well be differences between OpenRC and systemd, etc. Anyway, the code looks identical and at least on the one machine I've tested it doesn't seem to have hurt anythign to remove it from my fstab file. !Thanks! Cheers, Mark