FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 05-17-2011, 09:00 PM
Nirbheek Chauhan
 
Default rfc: use of the /run directory

2011/5/18 Olivier Crête <tester@gentoo.org>:
> 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/
>

Related is that you don't need to manually wipe /tmp /var/run
/var/lock via a service. They're automatically wiped when you reboot.
This saves time during bootup.


--
~Nirbheek Chauhan

Gentoo GNOME+Mozilla Team
 
Old 05-17-2011, 10:26 PM
Drake Wyrm
 
Default rfc: use of the /run directory

Nirbheek Chauhan <nirbheek@gentoo.org> wrote:
> 2011/5/18 Olivier Cr??te <tester@gentoo.org>:
> > 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/
> >
>
> Related is that you don't need to manually wipe /tmp /var/run
> /var/lock via a service. They're automatically wiped when you reboot.
> This saves time during bootup.

Even if you don't have to wipe them with a service, you're going to need
to mount them with a service. You'll need to mount /run as tmpfs, create
the /run/lock directory, and then mount /run/lock as tmpfs. Do you
really want to add that to localmount?

--
Confucius is inscrutable.
God is ineffable.
Beer is inevitable.
 
Old 05-17-2011, 10:36 PM
Marc Schiffbauer
 
Default rfc: use of the /run directory

* Drake Wyrm schrieb am 18.05.11 um 00:26 Uhr:
> Nirbheek Chauhan <nirbheek@gentoo.org> wrote:
> > 2011/5/18 Olivier Cr??te <tester@gentoo.org>:
> > > 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/
> > >
> >
> > Related is that you don't need to manually wipe /tmp /var/run
> > /var/lock via a service. They're automatically wiped when you reboot.
> > This saves time during bootup.
>
> Even if you don't have to wipe them with a service, you're going to need
> to mount them with a service. You'll need to mount /run as tmpfs, create
> the /run/lock directory, and then mount /run/lock as tmpfs. Do you
> really want to add that to localmount?

Why mount /run/lock as tmpfs? If its created within /run its already
tmpfs

-Marc
--
8AAC 5F46 83B4 DB70 8317 3723 296C 6CCA 35A6 4134
 
Old 05-17-2011, 10:46 PM
Nirbheek Chauhan
 
Default rfc: use of the /run directory

On Wed, May 18, 2011 at 3:56 AM, Drake Wyrm <wyrm@haell.com> wrote:
> Nirbheek Chauhan <nirbheek@gentoo.org> wrote:
> Even if you don't have to wipe them with a service, you're going to need
> to mount them with a service. You'll need to mount /run as tmpfs, create
> the /run/lock directory, and then mount /run/lock as tmpfs. Do you
> really want to add that to localmount?
>

(a) You don't need to mount anything except /run
(b) Creating a directory in tmpfs takes so little time it's not even
worth measuring. The same cannot be said of rotating media.


--
~Nirbheek Chauhan

Gentoo GNOME+Mozilla Team
 
Old 05-17-2011, 10:50 PM
Ciaran McCreesh
 
Default rfc: use of the /run directory

On Tue, 17 May 2011 11:57:48 -0500
William Hubbs <williamh@gentoo.org> wrote:
> I think we should support the /run directory [1] [2].

I would be interested to hear how you plan to do the migration, given
that everyone else has managed to screw it up...

--
Ciaran McCreesh
 
Old 05-18-2011, 12:06 AM
James Cloos
 
Default rfc: use of the /run directory

>>>>> "MC" == Markos Chandras <hwoarang@gentoo.org> writes:

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

Not everything is part of the distribution.

The one which first comes to mind are lock files placed to prevent
certain cron-initiated jobs from running right after a reboot.

Or locks preventing certain daemons from accepting connections.

Such locks often are used to protect net bandwidth when it is needed
for real-time use. A reboot of some random box on the lan should not
break such locks.

And /var/lock is the standard place to put and look for lock files.

Got to run; can't contiue to write right now....

-JimC
--
James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
 
Old 05-18-2011, 12:06 AM
William Hubbs
 
Default rfc: use of the /run directory

On Tue, May 17, 2011 at 03:26:11PM -0700, Drake Wyrm wrote:
> Nirbheek Chauhan <nirbheek@gentoo.org> wrote:
> > 2011/5/18 Olivier Cr??te <tester@gentoo.org>:
> > > 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/
> > >
> >
> > Related is that you don't need to manually wipe /tmp /var/run
> > /var/lock via a service. They're automatically wiped when you reboot.
> > This saves time during bootup.
>
> Even if you don't have to wipe them with a service, you're going to need
> to mount them with a service. You'll need to mount /run as tmpfs, create
> the /run/lock directory, and then mount /run/lock as tmpfs. Do you
> really want to add that to localmount?

Actually the code to do this is already in openrc git, and it is much
earlier than localmount. Also, you don't need a separate tmpfs for
/run/lock since /run is already tmpfs.

William
 
Old 05-18-2011, 12:12 AM
William Hubbs
 
Default rfc: use of the /run directory

On Tue, May 17, 2011 at 11:50:32PM +0100, Ciaran McCreesh wrote:
> On Tue, 17 May 2011 11:57:48 -0500
> William Hubbs <williamh@gentoo.org> wrote:
> > I think we should support the /run directory [1] [2].
>
> I would be interested to hear how you plan to do the migration, given
> that everyone else has managed to screw it up...

I'm not sure what you mean here. Openrc git will mount a tmpfs on /run
if it exists and create a lock directory inside the tmpfs.

To make it work, I just need a new release of baselayout to make the
/run directory. Then, I also need to figure out where in the boot
process to make the symbolic links from /var/lock to /run/lock and from
/var/run to /run.
what else am I missing?

William
 
Old 05-18-2011, 12:43 AM
William Hubbs
 
Default rfc: use of the /run directory

On Tue, May 17, 2011 at 08:06:46PM -0400, James Cloos wrote:
> >>>>> "MC" == Markos Chandras <hwoarang@gentoo.org> writes:
>
> MC> Can you please provide some examples that require /var/lock to
> MC> survive a reboot?
>
> Not everything is part of the distribution.
>
> The one which first comes to mind are lock files placed to prevent
> certain cron-initiated jobs from running right after a reboot.
>
> Or locks preventing certain daemons from accepting connections.
>
> Such locks often are used to protect net bandwidth when it is needed
> for real-time use. A reboot of some random box on the lan should not
> break such locks.

According to what I am reading in the fhs, /var/lock is not sharable
between multiple systems. Also, the contents of the lock file is
supposed to be the pid of the process that holds the lock [1].

Given that, a lock will automatically be invalid when you reboot, so it
should be forgotten about on a reboot.

William

[1] http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES
 
Old 05-18-2011, 01:31 AM
Duncan
 
Default rfc: use of the /run directory

William Hubbs posted on Tue, 17 May 2011 14:46:49 -0500 as excerpted:

> 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.

> 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.

Absolutely true.

I've run /tmp on tmpfs (with /var/tmp a symlink to it tho that took a bit
of additional setup) for some time now and love it, but it's easy enough
to do for those that want it that way, and controversial enough for others
that IMO Gentoo doesn't need to get into that policy game, /especially/
not when it unnecessarily complicates the otherwise entirely separate
/run discussion.

So let's leave /tmp (and /var/tmp) well enough alone and concentrate on
the subject at hand, /run and the /var/run symlinks to it.


Since I'm posting, I'd personally prefer keeping things pretty much as
they are, or arguably creating a /dev/run for the same benefits without a
new root directory. But I'm resigned to the fact that what will be will
be, and /run seems to have enough momentum behind it that it will be.
Given that, we might as well get it over with and get /run in place now,
before our lack of it starts causing serious problems and we have to
develop workarounds that must then be undone when we finally /do/ break
down and go with /run.

So reluctantly... but I say go for it.

--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
 

Thread Tools




All times are GMT. The time now is 07:18 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org