rfc: use of the /run directory

classic Classic list List threaded Threaded
44 messages Options
123
Reply | Threaded
Open this post in threaded view
|

rfc: use of the /run directory

William Hubbs
All,

I think we should support the /run directory [1] [2]. The issue is
that there are at least two packages, udev and dracut, in gentoo, which
support the use of this directory. Support for it is being worked on in
openrc, and systemd will use it once it comes into the tree.

For now, it is optionally  supported in udev, but udev upstream plans to
make this mandatory at some point in the future.

I, as well as several others, believe we should proactively create this
directory in a new release of baselayout, so that we will avoid bugs in
the future when packages start requiring it.

What does everyone else think?

William

[1] https://lwn.net/Articles/436012/
[2] http://bugs.gentoo.org/show_bug.cgi?id=361349

attachment0 (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

pva0xd
В Втр, 17/05/2011 в 11:57 -0500, William Hubbs пишет:
> I think we should support the /run directory [1] [2].

> I, as well as several others, believe we should proactively create this
> directory ... What does everyone else think?

I've read https://lwn.net/Articles/436012/ and that convinced me. Until
there is better solution, please, do it. Also I think it's good idea if
it'll be on tmpfs, as it should, from the very beginning.

--
Peter.


Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Nirbheek Chauhan-2
On Tue, May 17, 2011 at 11:41 PM, Peter Volkov <[hidden email]> wrote:

> В Втр, 17/05/2011 в 11:57 -0500, William Hubbs пишет:
>> I think we should support the /run directory [1] [2].
>
>> I, as well as several others, believe we should proactively create this
>> directory ... What does everyone else think?
>
> I've read https://lwn.net/Articles/436012/ and that convinced me. Until
> there is better solution, please, do it. Also I think it's good idea if
> it'll be on tmpfs, as it should, from the very beginning.
>

I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
both be on tmpfs by default. I've been doing this manually for a year,
and so have other distributions.


--
~Nirbheek Chauhan

Gentoo GNOME+Mozilla Team

Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Ângelo Arrifano (miknix)
On Tuesday 17 May 2011 20:28:56 Nirbheek Chauhan wrote:

> On Tue, May 17, 2011 at 11:41 PM, Peter Volkov <[hidden email]> wrote:
> > В Втр, 17/05/2011 в 11:57 -0500, William Hubbs пишет:
> >> I think we should support the /run directory [1] [2].
> >>
> >> I, as well as several others, believe we should proactively create this
> >> directory ... What does everyone else think?
> >
> > I've read https://lwn.net/Articles/436012/ and that convinced me. Until
> > there is better solution, please, do it. Also I think it's good idea if
> > it'll be on tmpfs, as it should, from the very beginning.
>
> I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
> both be on tmpfs by default. I've been doing this manually for a year,
> and so have other distributions.

The lwn article is definitely interesting to read, I welcome the new /run. I
wouldn't make /tmp as tmpfs though, there are some packages (wireshask I'm
looking at you) that can fill the directory fairly easy.

Regards,
--
Angelo Arrifano AKA MiKNiX
Gentoo Embedded developer
GPE maintainer
http://www.gentoo.org/~miknix
http://miknix.homelinux.com

Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Nirbheek Chauhan-2
On Wed, May 18, 2011 at 12:13 AM, Ângelo Arrifano <[hidden email]> wrote:
> On Tuesday 17 May 2011 20:28:56 Nirbheek Chauhan wrote:
>> I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
>> both be on tmpfs by default. I've been doing this manually for a year,
>> and so have other distributions.
>
> The lwn article is definitely interesting to read, I welcome the new /run. I
> wouldn't make /tmp as tmpfs though, there are some packages (wireshask I'm
> looking at you) that can fill the directory fairly easy.
>

I wonder what Fedora and Ubuntnu do to fix that. Maybe we should do
the same thing.


--
~Nirbheek Chauhan

Gentoo GNOME+Mozilla Team

Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

William Hubbs
In reply to this post by Nirbheek Chauhan-2
On Tue, May 17, 2011 at 11:58:56PM +0530, Nirbheek Chauhan wrote:

> On Tue, May 17, 2011 at 11:41 PM, Peter Volkov <[hidden email]> wrote:
> > В Втр, 17/05/2011 в 11:57 -0500, William Hubbs пишет:
> >> I think we should support the /run directory [1] [2].
> >
> >> I, as well as several others, believe we should proactively create this
> >> directory ... What does everyone else think?
> >
> > I've read https://lwn.net/Articles/436012/ and that convinced me. Until
> > there is better solution, please, do it. Also I think it's good idea if
> > it'll be on tmpfs, as it should, from the very beginning.
> >
>
> I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
> both be on tmpfs by default. I've been doing this manually for a year,
> and so have other distributions.
Once /run is in place,

/var/run will be a symbolic link to /run and /var/lock will be a
symbolic link to /run/lock.

So that will cover /var/run.

William


attachment0 (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

pva0xd
In reply to this post by Ângelo Arrifano (miknix)
В Втр, 17/05/2011 в 20:43 +0200, Ângelo Arrifano пишет:
> On Tuesday 17 May 2011 20:28:56 Nirbheek Chauhan wrote:
> > I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
> > both be on tmpfs by default. I've been doing this manually for a year,
> > and so have other distributions.
>
> The lwn article is definitely interesting to read, I welcome the new /run. I
> wouldn't make /tmp as tmpfs though, there are some packages (wireshask I'm
> looking at you) that can fill the directory fairly easy.

Hm, may be I miss something... but how wireshark fills /run? As far as I
see dumps go into /tmp.

--
Peter.


Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Ângelo Arrifano (miknix)
On Tuesday 17 May 2011 21:11:12 Peter Volkov wrote:

> В Втр, 17/05/2011 в 20:43 +0200, Ângelo Arrifano пишет:
> > On Tuesday 17 May 2011 20:28:56 Nirbheek Chauhan wrote:
> > > I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
> > > both be on tmpfs by default. I've been doing this manually for a year,
> > > and so have other distributions.
> >
> > The lwn article is definitely interesting to read, I welcome the new
> > /run. I wouldn't make /tmp as tmpfs though, there are some packages
> > (wireshask I'm looking at you) that can fill the directory fairly easy.
>
> Hm, may be I miss something... but how wireshark fills /run? As far as I
> see dumps go into /tmp.
>
> --
> Peter.

Either one of us is needing a break away from the computer to relax the eyes,
which one is it? :P
--
Angelo Arrifano AKA MiKNiX
Gentoo Embedded developer
GPE maintainer
http://www.gentoo.org/~miknix
http://miknix.homelinux.com

Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Panagiotis Christopoulos
In reply to this post by Nirbheek Chauhan-2
On 23:58 Tue 17 May     , Nirbheek Chauhan wrote:
> ...
> I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
> both be on tmpfs by default. I've been doing this manually for a year,
> and so have other distributions.
>

Hi,

A quick look at the size of my desktop's /tmp is:

spirit@Vereniki ~ $ du -sh /tmp/
641M /tmp/
spirit@Vereniki ~ $

Maybe it's just me (cause of the way I'm using /tmp, eg. I use that dir
to unpack sources of packages I want to temporarily look inside and
for anything else *temporary*, also some programs (eg. browsers) use it
for temporary storage) but if there are others like me, I don't
think we'd like to do this in RAM space (tmpfs). For /run and /var/run
dirs it's ok I suppose.

--
Panagiotis Christopoulos ( pchrist )
    ( Gentoo Lisp Project )

attachment0 (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

William Hubbs
On Tue, May 17, 2011 at 10:20:56PM +0300, Panagiotis Christopoulos wrote:

> On 23:58 Tue 17 May     , Nirbheek Chauhan wrote:
> > ...
> > I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
> > both be on tmpfs by default. I've been doing this manually for a year,
> > and so have other distributions.
> >
>
> Hi,
>
> A quick look at the size of my desktop's /tmp is:
>
> spirit@Vereniki ~ $ du -sh /tmp/
> 641M /tmp/
> spirit@Vereniki ~ $
>
> Maybe it's just me (cause of the way I'm using /tmp, eg. I use that dir
> to unpack sources of packages I want to temporarily look inside and
> for anything else *temporary*, also some programs (eg. browsers) use it
> for temporary storage) but if there are others like me, I don't
> think we'd like to do this in RAM space (tmpfs). For /run and /var/run
> dirs it's ok I suppose.
If you want /tmp to be a tmpfs, that is pretty easy to do through fstab
(I do that here actually). I'm not sure whether we want to force that on
a distribution level or not though.

The directories that would be affected by having /run on tmpfs would be
/var/run and /var/lock. The suggested way of doing this is to have
/var/run linked to /run and /var/lock linked to /run/lock.

William


attachment0 (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Nirbheek Chauhan-2
In reply to this post by Panagiotis Christopoulos
On Wed, May 18, 2011 at 12:50 AM, Panagiotis Christopoulos
<[hidden email]> wrote:

> On 23:58 Tue 17 May     , Nirbheek Chauhan wrote:
>> ...
>> I'd add that if we want /run to be on tmpfs, /var/run and /tmp should
>> both be on tmpfs by default. I've been doing this manually for a year,
>> and so have other distributions.
>>
>
> Hi,
>
> A quick look at the size of my desktop's /tmp is:
>
> spirit@Vereniki ~ $ du -sh /tmp/
> 641M    /tmp/
> spirit@Vereniki ~ $
>
> Maybe it's just me (cause of the way I'm using /tmp, eg. I use that dir
> to unpack sources of packages I want to temporarily look inside and
> for anything else *temporary*, also some programs (eg. browsers) use it
> for temporary storage) but if there are others like me, I don't
> think we'd like to do this in RAM space (tmpfs). For /run and /var/run
> dirs it's ok I suppose.
>

Maybe you should use /var/tmp for that? Or ~/tmp/ ?

OTOH, we could use an rc.conf configuration variable to control
whether /tmp is mounted as tmpfs.

--
~Nirbheek Chauhan

Gentoo GNOME+Mozilla Team

Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Olivier Crête
On Wed, 2011-05-18 at 01:18 +0530, Nirbheek Chauhan wrote:
> Maybe you should use /var/tmp for that? Or ~/tmp/ ?
>
> OTOH, we could use an rc.conf configuration variable to control
> whether /tmp is mounted as tmpfs.

Having /tmp and /var/tmp as tmpfs sounds like a terrible idea.. I don't
think we should facilitate it in any way.

--
Olivier Crête
[hidden email]
Gentoo Developer

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Michał Górny-5
On Tue, 17 May 2011 16:00:41 -0400
Olivier Crête <[hidden email]> wrote:

> On Wed, 2011-05-18 at 01:18 +0530, Nirbheek Chauhan wrote:
> > Maybe you should use /var/tmp for that? Or ~/tmp/ ?
> >
> > OTOH, we could use an rc.conf configuration variable to control
> > whether /tmp is mounted as tmpfs.
>
> Having /tmp and /var/tmp as tmpfs sounds like a terrible idea.. I
> don't think we should facilitate it in any way.

I always thought we're having two separate temporary directories
because /tmp is for small data (i.e. suitable for tmpfs) while /var/tmp
is for larger one.

--
Best regards,
Michał Górny

signature.asc (325 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

aidecoe
In reply to this post by Olivier Crête
Excerpts from Olivier Crête's message of Tue May 17 22:00:41 +0200 2011:
> On Wed, 2011-05-18 at 01:18 +0530, Nirbheek Chauhan wrote:
> > Maybe you should use /var/tmp for that? Or ~/tmp/ ?
> >
> > OTOH, we could use an rc.conf configuration variable to control
> > whether /tmp is mounted as tmpfs.
>
> Having /tmp and /var/tmp as tmpfs sounds like a terrible idea.. I
> don't think we should facilitate it in any way.

I think he just meant that /var/tmp should be used for bigger temporary
stuff.  This how I use it.  /tmp for tiny temporary stuff and /var/tmp/
for bigger which would be good to have preserved between reboots.  And
this is somehow correct with FHS afaik.


--
Amadeusz Żołnowski

PGP key fpr: C700 CEDE 0C18 212E 49DA  4653 F013 4531 E1DB FAB5

signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Panagiotis Christopoulos
In reply to this post by Nirbheek Chauhan-2
On 01:18 Wed 18 May     , Nirbheek Chauhan wrote:
> ...
> Maybe you should use /var/tmp for that? Or ~/tmp/ ?
>
Yes, I can do that. But the real question here, from my perspective, is
why we need /run, /var/run or /tmp on tmpfs. "Other distros do it" is
not an answer. Yes, I needed those dirs on tmpfs twice in my life, once
when I was building a cluster with diskless nodes (with / on readonly
NFS) and once more  when I was working with an "LTSP" alike system,
but these were exceptions, at that time.
As I don't have the knowledge for this and I currently don't have the
time to google/search it myself, can someone explain why other linux
distibutions / Unix systems (wikipedia says that Solaris had /tmp on
tmpfs from 1994) started putting directories on tmpfs and technically
speaking what an average user would benefit from having /run, /tmp etc.
directories on tmpfs?

--
Panagiotis Christopoulos ( pchrist )
    ( Gentoo Lisp Project )

attachment0 (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Rich Freeman
In reply to this post by Olivier Crête
2011/5/17 Olivier Crête <[hidden email]>:
> On Wed, 2011-05-18 at 01:18 +0530, Nirbheek Chauhan wrote:
>> Maybe you should use /var/tmp for that? Or ~/tmp/ ?
>>
>> OTOH, we could use an rc.conf configuration variable to control
>> whether /tmp is mounted as tmpfs.
>
> Having /tmp and /var/tmp as tmpfs sounds like a terrible idea.. I don't
> think we should facilitate it in any way.

I've run my system this way for ages - even back when I had 2GB of RAM
running kde, samba, mythtv, mysql, and apache.  Usually not a problem.
 Unfortunately the kernel swapping logic isn't perfect, which can
cause it to bog down if you're compiling something like chromium or
openoffice.

When you think about it tmpfs on swap should be no slower than ext3.
If anything it should be faster since it doesn't need to journal.  In
practice it doesn't always work this way, but I'd consider this a bug.
 With a filesystem, anything you write ends up on disk within 30
seconds or whatever.  With a tmpfs, some of the stuff you write ends
up on disk, and the kernel has more freedom with how it goes about
doing this.

Then problem comes when the kernel decides to swap out mysql or
whatever in order to hang onto some pages full of .so files or
whatever from your latest build.

Rich

Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Michał Górny-5
In reply to this post by Panagiotis Christopoulos
On Tue, 17 May 2011 23:20:59 +0300
Panagiotis Christopoulos <[hidden email]> wrote:

> As I don't have the knowledge for this and I currently don't have the
> time to google/search it myself, can someone explain why other linux
> distibutions / Unix systems (wikipedia says that Solaris had /tmp on
> tmpfs from 1994) started putting directories on tmpfs and technically
> speaking what an average user would benefit from having /run, /tmp
> etc. directories on tmpfs?

For me, the most important advantage is that files get removed whenever
the system crashes for some reason. It's just simpler (and more error
prone) to have them gone automagically than to add services to remove
all of them on each boot.

--
Best regards,
Michał Górny

signature.asc (325 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

James Cloos-9
In reply to this post by William Hubbs
>>>>> "WH" == William Hubbs <[hidden email]> writes:

WH> Once /run is in place,

WH> /var/run will be a symbolic link to /run and /var/lock will
WH> be a symbolic link to /run/lock.

There are files which need to be in /var/lock and which should
survive a reboot, so it is not a good idea to make /var/lock
a symlink to /run/lock.

(And I don't just mean .keep files.)

-JimC
--
James Cloos <[hidden email]>         OpenPGP: 1024D/ED7DAEA6

Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Markos Chandras-2
On Tue, May 17, 2011 at 04:35:00PM -0400, James Cloos wrote:

> >>>>> "WH" == William Hubbs <[hidden email]> writes:
>
> WH> Once /run is in place,
>
> WH> /var/run will be a symbolic link to /run and /var/lock will
> WH> be a symbolic link to /run/lock.
>
> There are files which need to be in /var/lock and which should
> survive a reboot, so it is not a good idea to make /var/lock
> a symlink to /run/lock.
>
> (And I don't just mean .keep files.)
>
> -JimC
> --
> James Cloos <[hidden email]>         OpenPGP: 1024D/ED7DAEA6
>
James,

Can you please provide some examples that require /var/lock to survive a
reboot?

Regards,
--
Markos Chandras / Gentoo Linux Developer / Key ID: B4AFF2C2

attachment0 (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rfc: use of the /run directory

Olivier Crête
In reply to this post by Panagiotis Christopoulos
On Tue, 2011-05-17 at 23:20 +0300, Panagiotis Christopoulos wrote:
> Yes, I can do that. But the real question here, from my perspective, is
> why we need /run, /var/run or /tmp on tmpfs. "Other distros do it" is
> not an answer.

The main reason is that you want /run to be writable super early in the
boot process, before even / has been fscked and re-mounted. That means
you can do stuff like starting udevd in parallel with fsck of / which
means faster boot. This is one of the things required to get 1 second
boot.

See http://lwn.net/Articles/436012/

--
Olivier Crête
[hidden email]
Gentoo Developer

signature.asc (205 bytes) Download Attachment
123