Re: ownership of /proc and /sys

2019-07-24 Thread Lennart Poettering
On Mi, 24.07.19 13:24, Jun Aruga (jar...@redhat.com) wrote:

> Sorry I posted my previous email wrongly.
>
> > > I have bunch of ideas, but all of them ugly (e.g., not own that file and 
> > > create that directories in scriptlet). Do you
> > > have any ideas about this situation?
> >
> > Make systemd create them? It has to manage them anyway.
>
> I see this situation to think about the ownership of /proc happens
> when qemu-user-static RPM creates new
> /proc/sys/fs/binfmt_misc/qemu-$cpu files by "dnf install
> qemu-user-static" through running systemd. [1]
> Who is the owner of the /proc/sys/fs/binfmt_misc/qemu-$cpu files?
> The possible solution I am considering is "(e.g., not own that file
> and create that directories in scriptlet)".

These directories are runtime objects, i.e. kernel API exposed as a
file system. RPM should not own files below /proc. Something should
own/create /proc itself, since it needs to exist to be overmounted
with procfs, but beyond that stuff below /proc should be off limits
for any package manager I figure.

Lennart

--
Lennart Poettering, Berlin
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: ownership of /proc and /sys

2019-07-24 Thread Jun Aruga
Sorry I posted my previous email wrongly.

> > I have bunch of ideas, but all of them ugly (e.g., not own that file and 
> > create that directories in scriptlet). Do you
> > have any ideas about this situation?
>
> Make systemd create them? It has to manage them anyway.

I see this situation to think about the ownership of /proc happens
when qemu-user-static RPM creates new
/proc/sys/fs/binfmt_misc/qemu-$cpu files by "dnf install
qemu-user-static" through running systemd. [1]
Who is the owner of the /proc/sys/fs/binfmt_misc/qemu-$cpu files?
The possible solution I am considering is "(e.g., not own that file
and create that directories in scriptlet)".

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1732178

-- 
Jun Aruga | He - His - Him
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: ownership of /proc and /sys

2019-07-24 Thread Jun Aruga
> I have bunch of ideas, but all of them ugly (e.g., not own that file and 
> create that directories in scriptlet). Do you
> have any ideas about this situation?

Make systemd create them? It has to manage them anyway.

On Tue, Jul 23, 2019 at 5:30 PM Lennart Poettering  wrote:
>
> On Di, 23.07.19 10:56, Adam Jackson (a...@redhat.com) wrote:
>
> > On Tue, 2019-07-23 at 11:01 +0200, Miroslav Suchý wrote:
> > > Hi,
> > > directories /proc/ and /sys/ are owned by filesystem package. This worked 
> > > in past where we needed those directories to
> > > exist so we can mount the procfs and sysfs.
> > >
> > > However this cause issues in containers:
> > > https://bugzilla.redhat.com/show_bug.cgi?id=1548403
> > > and during building where hacks are needed:
> > > https://github.com/rpm-software-management/mock/pull/234/commits/d7e0b413c83bec00fd1ed75ee15122a9cc6db62e
> > >
> > > I have bunch of ideas, but all of them ugly (e.g., not own that file and 
> > > create that directories in scriptlet). Do you
> > > have any ideas about this situation?
> >
> > Make systemd create them? It has to manage them anyway.
>
> It does, if they are missing. In fact, it's totally supported to boot
> up with an empty / (for example: tmpfs, which is what
> systemd.volatile=yes on the kernel cmdline will do) with the one
> exception of a populated /usr and systemd will create all the basic
> mount points and symlinks needed to make the system boot.
>
> That said, that only works if / is writable. Which is not a given.
>
> Lennart
>
> --
> Lennart Poettering, Berlin
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org



-- 
Jun Aruga | He - His - Him
jar...@redhat.com / IRC: jaruga
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: ownership of /proc and /sys

2019-07-23 Thread Lennart Poettering
On Di, 23.07.19 10:56, Adam Jackson (a...@redhat.com) wrote:

> On Tue, 2019-07-23 at 11:01 +0200, Miroslav Suchý wrote:
> > Hi,
> > directories /proc/ and /sys/ are owned by filesystem package. This worked 
> > in past where we needed those directories to
> > exist so we can mount the procfs and sysfs.
> >
> > However this cause issues in containers:
> > https://bugzilla.redhat.com/show_bug.cgi?id=1548403
> > and during building where hacks are needed:
> > https://github.com/rpm-software-management/mock/pull/234/commits/d7e0b413c83bec00fd1ed75ee15122a9cc6db62e
> >
> > I have bunch of ideas, but all of them ugly (e.g., not own that file and 
> > create that directories in scriptlet). Do you
> > have any ideas about this situation?
>
> Make systemd create them? It has to manage them anyway.

It does, if they are missing. In fact, it's totally supported to boot
up with an empty / (for example: tmpfs, which is what
systemd.volatile=yes on the kernel cmdline will do) with the one
exception of a populated /usr and systemd will create all the basic
mount points and symlinks needed to make the system boot.

That said, that only works if / is writable. Which is not a given.

Lennart

--
Lennart Poettering, Berlin
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: ownership of /proc and /sys

2019-07-23 Thread Adam Jackson
On Tue, 2019-07-23 at 11:01 +0200, Miroslav Suchý wrote:
> Hi,
> directories /proc/ and /sys/ are owned by filesystem package. This worked in 
> past where we needed those directories to
> exist so we can mount the procfs and sysfs.
> 
> However this cause issues in containers:
> https://bugzilla.redhat.com/show_bug.cgi?id=1548403
> and during building where hacks are needed:
> https://github.com/rpm-software-management/mock/pull/234/commits/d7e0b413c83bec00fd1ed75ee15122a9cc6db62e
> 
> I have bunch of ideas, but all of them ugly (e.g., not own that file and 
> create that directories in scriptlet). Do you
> have any ideas about this situation?

Make systemd create them? It has to manage them anyway.

- ajax
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


ownership of /proc and /sys

2019-07-23 Thread Miroslav Suchý
Hi,
directories /proc/ and /sys/ are owned by filesystem package. This worked in 
past where we needed those directories to
exist so we can mount the procfs and sysfs.

However this cause issues in containers:
https://bugzilla.redhat.com/show_bug.cgi?id=1548403
and during building where hacks are needed:
https://github.com/rpm-software-management/mock/pull/234/commits/d7e0b413c83bec00fd1ed75ee15122a9cc6db62e

I have bunch of ideas, but all of them ugly (e.g., not own that file and create 
that directories in scriptlet). Do you
have any ideas about this situation?

-- 
Miroslav Suchy, RHCA
Red Hat, Associate Manager ABRT/Copr, #brno, #fedora-buildsys
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org