Patchwork [v3] base-files: add /run directory from FHS 3 draft specification

login
register
mail settings
Submitter Ross Burton
Date May 22, 2013, 4:33 p.m.
Message ID <CAJTo0LawHFMUtJHzYGqyCzHA8sJhwC4x9xF1PwSUkZ4AB34j0Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/50331/
State New
Headers show

Comments

Ross Burton - May 22, 2013, 4:33 p.m.
Hi Jonathan

On 22 May 2013 02:47, Jonathan Liu <net147@gmail.com> wrote:
> This adds the /run directory from the Filesystem Hierarchy Standard 3.0
> Draft [1] and refactors the filesystem as follows:

Good start!

> - Remove /var/run from dbus package as it is created on startup
> - Remove /var/volatile/run/resolvconf/interface from resolvconf package
>   as resolvconf package uses /etc/resolvconf/run/interface

Can these be separate patches, as they're essentially unrelated cleanups.

Please also drop all PR changes, they're not needed in oe-core.

> diff --git a/meta/files/fs-perms.txt b/meta/files/fs-perms.txt
> index becb85c..c829bec 100644
> --- a/meta/files/fs-perms.txt
> +++ b/meta/files/fs-perms.txt
> @@ -45,15 +45,14 @@ ${oldincludedir}    0755    root    root    true    0644    root    root
>
>  # Items from base-files
>  # Links
> -${localstatedir}/run   link    volatile/run
> +${localstatedir}/run   link    /run
>  ${localstatedir}/log   link    volatile/log
> -${localstatedir}/lock  link    volatile/lock
> +${localstatedir}/lock  link    /run/lock
>  ${localstatedir}/tmp   link    volatile/tmp
>
>  # Special permissions from base-files
>  # Set 1777
>  /tmp                           01777   root    root    false - - -
> -${localstatedir}/volatile/lock 01777   root    root    false - - -
>  ${localstatedir}/volatile/tmp  01777   root    root    false - - -

Nothing appears to sets mode 1777 on /run/lock.  Then again Fedora
thinks that 0755 is sufficient, although Debian uses 1777.  We should
probably keep the permissions as 1777.

Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton - May 22, 2013, 4:35 p.m.
On 22 May 2013 17:33, Burton, Ross <ross.burton@intel.com> wrote:
> On 22 May 2013 02:47, Jonathan Liu <net147@gmail.com> wrote:
>> This adds the /run directory from the Filesystem Hierarchy Standard 3.0
>> Draft [1] and refactors the filesystem as follows:

Oh, and have you tested the migration path, i.e. from a current master
image, upgrade to a feed built with this patch in?

Ross
Jonathan Liu - May 23, 2013, 3:20 a.m.
On 23 May 2013 02:33, Burton, Ross <ross.burton@intel.com> wrote:

> Hi Jonathan
>
> On 22 May 2013 02:47, Jonathan Liu <net147@gmail.com> wrote:
> > This adds the /run directory from the Filesystem Hierarchy Standard 3.0
> > Draft [1] and refactors the filesystem as follows:
>
> Good start!
>
> > - Remove /var/run from dbus package as it is created on startup
> > - Remove /var/volatile/run/resolvconf/interface from resolvconf package
> >   as resolvconf package uses /etc/resolvconf/run/interface
>
> Can these be separate patches, as they're essentially unrelated cleanups.
>
Ok.


> Please also drop all PR changes, they're not needed in oe-core.
>

Ok.

>
> > diff --git a/meta/files/fs-perms.txt b/meta/files/fs-perms.txt
> > index becb85c..c829bec 100644
> > --- a/meta/files/fs-perms.txt
> > +++ b/meta/files/fs-perms.txt
> > @@ -45,15 +45,14 @@ ${oldincludedir}    0755    root    root    true
>  0644    root    root
> >
> >  # Items from base-files
> >  # Links
> > -${localstatedir}/run   link    volatile/run
> > +${localstatedir}/run   link    /run
> >  ${localstatedir}/log   link    volatile/log
> > -${localstatedir}/lock  link    volatile/lock
> > +${localstatedir}/lock  link    /run/lock
> >  ${localstatedir}/tmp   link    volatile/tmp
> >
> >  # Special permissions from base-files
> >  # Set 1777
> >  /tmp                           01777   root    root    false - - -
> > -${localstatedir}/volatile/lock 01777   root    root    false - - -
> >  ${localstatedir}/volatile/tmp  01777   root    root    false - - -
>
> Nothing appears to sets mode 1777 on /run/lock.  Then again Fedora
> thinks that 0755 is sufficient, although Debian uses 1777.  We should
> probably keep the permissions as 1777.
>
For sysvinit case, /run/lock is created with root:root owner and 1777
permissions by populate-volatiles.sh.
For systemd case, /run/lock is created with root:root owner and 0755
permissions by /usr/lib/tmpfiles.d/legacy.conf -
http://cgit.freedesktop.org/systemd/systemd/tree/tmpfiles.d/legacy.conf.
Presumably any system using the stock systemd legacy.conf, it would be
using 0755 permissions. This is true on Arch Linux and Fedora for example.
I would generally prefer to stick with permissions from systemd upstream.
What is your opinion on the matter?


> diff --git a/meta/recipes-core/dbus/dbus.inc
> b/meta/recipes-core/dbus/dbus.inc
> index 2be5bda..8055824 100644
> --- a/meta/recipes-core/dbus/dbus.inc
> +++ b/meta/recipes-core/dbus/dbus.inc
> @@ -101,9 +101,9 @@ do_install() {
>              > ${D}${sysconfdir}/default/volatiles/99_dbus
>
>
> -       mkdir -p ${D}${localstatedir}/run/dbus
> ${D}${localstatedir}/lib/dbus
> +       mkdir -p ${D}${localstatedir}/lib/dbus
>
> Presumably dbus will create /run/dbus if required?
>
> Ross
>
/run/dbus is created automatically on boot.
For sysvinit case, it is created by populate-volatiles.sh which also sets
messagebus:messagebus owner.
For systemd case, it is created when dbus.socket (a dependency of
dbus.service) is started by systemd. dbus.socket implicitly creates it when
specifying:
[Socket]
ListenStream=/var/run/dbus/system_bus_socket

Regards,
Jonathan

Patch

diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index 2be5bda..8055824 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -101,9 +101,9 @@  do_install() {
             > ${D}${sysconfdir}/default/volatiles/99_dbus


-       mkdir -p ${D}${localstatedir}/run/dbus ${D}${localstatedir}/lib/dbus
+       mkdir -p ${D}${localstatedir}/lib/dbus

Presumably dbus will create /run/dbus if required?

Ross
_______________________________________________