Patchwork base-files: Add /run/lock as a standard directory

login
register
mail settings
Submitter Mark Hatle
Date May 8, 2014, 11:24 p.m.
Message ID <1399591490-13000-1-git-send-email-mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/71793/
State New
Headers show

Comments

Mark Hatle - May 8, 2014, 11:24 p.m.
rpm -V -qa

Will report:

Unsatisfied dependencies for base-files-3.0.14-r73.2.0.qemux86_64:
/proc/mounts
/run/lock

The /run/lock directory was being dynamically created during package install,
but should have been owned by the base-files package.

(Note: /proc/mounts is a different issue)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Ross Burton - May 9, 2014, 9:16 a.m.
On 9 May 2014 00:24, Mark Hatle <mark.hatle@windriver.com> wrote:
> The /run/lock directory was being dynamically created during package install,
> but should have been owned by the base-files package.

Doesn't do_install generate the /var/run/lock -> /run/lock symlink, as
/run is always a tmpfs so has to be populated on boot?

Ross
Mark Hatle - May 9, 2014, 3:14 p.m.
On 5/9/14, 4:16 AM, Burton, Ross wrote:
> On 9 May 2014 00:24, Mark Hatle <mark.hatle@windriver.com> wrote:
>> The /run/lock directory was being dynamically created during package install,
>> but should have been owned by the base-files package.
>
> Doesn't do_install generate the /var/run/lock -> /run/lock symlink, as
> /run is always a tmpfs so has to be populated on boot?
>

The /var/run/lock -> /run/lock symlink is generated, but the /run/lock is never 
created by anything that I could find.

/run is not always a tmpfs...  We've got configurations where it's persistent.

With that said, the fix may be incorrect though if something is generally used 
to create this as a tmpfs, which package would normally create the directory and 
populate it?  the volatiles code?

--Mark

> Ross
>
Saul Wold - May 9, 2014, 3:31 p.m.
On 05/09/2014 08:14 AM, Mark Hatle wrote:
> On 5/9/14, 4:16 AM, Burton, Ross wrote:
>> On 9 May 2014 00:24, Mark Hatle <mark.hatle@windriver.com> wrote:
>>> The /run/lock directory was being dynamically created during package
>>> install,
>>> but should have been owned by the base-files package.
>>
>> Doesn't do_install generate the /var/run/lock -> /run/lock symlink, as
>> /run is always a tmpfs so has to be populated on boot?
>>
>
> The /var/run/lock -> /run/lock symlink is generated, but the /run/lock
> is never created by anything that I could find.
>
> /run is not always a tmpfs...  We've got configurations where it's
> persistent.
>
> With that said, the fix may be incorrect though if something is
> generally used to create this as a tmpfs, which package would normally
> create the directory and populate it?  the volatiles code?
>

Ross is almost correct here, there is a link generated from via the 
volatiles file in initscripts recipe, which will be created during 
package install time.

Sau!

> --Mark
>
>> Ross
>>
>
Mark Hatle - May 9, 2014, 3:50 p.m.
On 5/9/14, 10:31 AM, Saul Wold wrote:
> On 05/09/2014 08:14 AM, Mark Hatle wrote:
>> On 5/9/14, 4:16 AM, Burton, Ross wrote:
>>> On 9 May 2014 00:24, Mark Hatle <mark.hatle@windriver.com> wrote:
>>>> The /run/lock directory was being dynamically created during package
>>>> install,
>>>> but should have been owned by the base-files package.
>>>
>>> Doesn't do_install generate the /var/run/lock -> /run/lock symlink, as
>>> /run is always a tmpfs so has to be populated on boot?
>>>
>>
>> The /var/run/lock -> /run/lock symlink is generated, but the /run/lock
>> is never created by anything that I could find.
>>
>> /run is not always a tmpfs...  We've got configurations where it's
>> persistent.
>>
>> With that said, the fix may be incorrect though if something is
>> generally used to create this as a tmpfs, which package would normally
>> create the directory and populate it?  the volatiles code?
>>
>
> Ross is almost correct here, there is a link generated from via the
> volatiles file in initscripts recipe, which will be created during
> package install time.

We still have the packaging issue though.  Nothing 'owns' that directory, yet 
other package(s) reference it.  At a minimum something should own it (or it 
needs to get shoved into the /etc/rpm/sysinfo/Dirnames file to show yes, the 
directory really is available.)

/proc/mounts has always been an issue since it's owned by the system, but that 
can be dealt with using the same type of this /etc/rpm/sysinfo/Providenames....

(There is a feature enhancement in the YP bugzilla to more easily support a 
persistent filesystem, vs always using the volatiles..  we probably should drop 
this for now and come back around when that is investigated.)

--Mark

> Sau!
>
>> --Mark
>>
>>> Ross
>>>
>>
Colin Walters - May 9, 2014, 7:41 p.m.
On Fri, May 9, 2014 at 11:14 AM, Mark Hatle <mark.hatle@windriver.com> 
wrote:
> 
> /run is not always a tmpfs...  We've got configurations where it's 
> persistent.

What?  Why?
Mark Hatle - May 9, 2014, 8:35 p.m.
On 5/9/14, 2:41 PM, Colin Walters wrote:
> On Fri, May 9, 2014 at 11:14 AM, Mark Hatle <mark.hatle@windriver.com>
> wrote:
>>
>> /run is not always a tmpfs...  We've got configurations where it's
>> persistent.
>
> What?  Why?
>

Certain system configurations may require parts of the /run filesystem to not 
always be on tmpfs.  (Some situations where you have a lot of disk, but limited 
ram for instance..  using tmpfs will potentially put your system into a low 
memory state, or you might not have enough tmpfs to run the system properly.)

As part of the future work to allow for persistent storage on certain things 
that the volatiles are doing right now, /run is one of the directories that 
needs to be investigated.  Is there actually anything there that may be 
desirable to persist from one boot to the next?

--Mark
Colin Walters - May 9, 2014, 8:50 p.m.
On Fri, May 9, 2014 at 4:35 PM, Mark Hatle <mark.hatle@windriver.com> 
wrote:
> 
> Certain system configurations may require parts of the /run 
> filesystem to not always be on tmpfs.  (Some situations where you 
> have a lot of disk, but limited ram for instance..  using tmpfs will 
> potentially put your system into a low memory state, or you might not 
> have enough tmpfs to run the system properly.)

I understand not doing /tmp-on-tmpfs, but /run?  Fix the parts of 
userspace that are allocating significant memory there.

And if you're really not mounting /run as tmpfs, I hope you're ensuring 
it's emptied immediately after mounting.

>  /run is one of the directories that needs to be investigated.  Is 
> there actually anything there that may be desirable to persist from 
> one boot to the next?

No.  It not being persistent is part of the API contract.
http://lwn.net/Articles/436012/

Patch

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 6d76a2b..d38d30b 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -34,8 +34,8 @@  docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
 dirs2775 = "/home ${prefix}/src ${localstatedir}/local"
 dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
-           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
-           ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
+           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /run/lock \
+           /sbin ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
            ${mandir} ${datadir}/misc ${localstatedir} \