public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
@ 2009-01-17 23:07 Robin H. Johnson
  2009-01-17 23:52 ` Friedrich Oslage
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Robin H. Johnson @ 2009-01-17 23:07 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

I'm raising this as an extension of bug 253076, but also because I see
the potential for danger.

To date, for an init script that has baselayout2-specific behavior, we
have had some variant of [ -e /lib/librc.so ] in the init script.

On a multilib profile with no symlinks and a 64-bit userspace, the .so
file would be installed in /lib64/librc.so, and the check would
mistakenly have the wrong result. 

There's one fix that has started to turn up already, but I'm not sure if
it's going to be safe always: [ -f /etc/init.d/sysfs ]
This happens to work as openrc installs that init script.

As a long term solution, can we just consume an inode and have some file
like /etc/baselayout2? The file must reside on the / partition even when
the major trees /usr, /var, /tmp, /opt, /boot, /home, /dev, /root are
separate mountpoints.

Affected and broken profiles:
- amd64's 2005.0/no-symlink (it was very widely deployed. It's not
  supported or in the tree anymore, but there ARE still people using it)
- default/linux/sparc/2008.0 (unconfirmed)
- Any profile that sets SYMLINK_LIB="no" AND the userspace is 64-bit.
- Wouldn't surprise me if some of the N32 style mips stuff was broken
  too.

Affected, but not broken profiles:
These are multilib, but with the default as 32-bit causes the lib to be
in right place.
- arch/powerpc/ppc64/32ul
- hardened/linux/powerpc/ppc64/2008.0/32bit-userland
- Any other profile that inherits features/32bit-userland

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 329 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-17 23:07 [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage Robin H. Johnson
@ 2009-01-17 23:52 ` Friedrich Oslage
  2009-01-18  7:17   ` [gentoo-dev] " Duncan
                     ` (2 more replies)
  2009-01-19  3:11 ` Donnie Berkholz
  2009-01-20 14:17 ` Matthias Schwarzott
  2 siblings, 3 replies; 9+ messages in thread
From: Friedrich Oslage @ 2009-01-17 23:52 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robin H. Johnson schrieb:
> I'm raising this as an extension of bug 253076, but also because I see
> the potential for danger.
> 
> To date, for an init script that has baselayout2-specific behavior, we
> have had some variant of [ -e /lib/librc.so ] in the init script.
> 
> On a multilib profile with no symlinks and a 64-bit userspace, the .so
> file would be installed in /lib64/librc.so, and the check would
> mistakenly have the wrong result. 
> 
> There's one fix that has started to turn up already, but I'm not sure if
> it's going to be safe always: [ -f /etc/init.d/sysfs ]
> This happens to work as openrc installs that init script.
> 
> As a long term solution, can we just consume an inode and have some file
> like /etc/baselayout2? The file must reside on the / partition even when
> the major trees /usr, /var, /tmp, /opt, /boot, /home, /dev, /root are
> separate mountpoints.

Using a file in /etc would break if someone would downgrade from
baselayout2/openrc to baselayout1.

Why not teach /sbin/runscript it's own version? With something like this
 we could also do stuff depending on a specific version of openrc:

- --- src/rc/runscript.c
+++ src/rc/runscript.c
@@ -1244,6 +1244,7 @@ runscript(int argc, char **argv)

        setenv("EINFO_LOG", service, 1);
        setenv("RC_SVCNAME", applet, 1);
+       setenv("OPENRC_VERSION", "0.4.2", 1);

        /* Set an env var so that we always know our pid regardless of
any
           subshells the init script may create so that our mark_service_*


and in the ebuild:

[ -n "${OPENRC_VERSION}" ]

> 
> Affected and broken profiles:
> - amd64's 2005.0/no-symlink (it was very widely deployed. It's not
>   supported or in the tree anymore, but there ARE still people using it)
> - default/linux/sparc/2008.0 (unconfirmed)

That one should be fine. It has a pure 32bit userland, no lib64 or
lib32, just plain lib as libdir.

> - Any profile that sets SYMLINK_LIB="no" AND the userspace is 64-bit.
> - Wouldn't surprise me if some of the N32 style mips stuff was broken
>   too.
> 
> Affected, but not broken profiles:
> These are multilib, but with the default as 32-bit causes the lib to be
> in right place.
> - arch/powerpc/ppc64/32ul
> - hardened/linux/powerpc/ppc64/2008.0/32bit-userland
> - Any other profile that inherits features/32bit-userland
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklybyAACgkQknxn9PmJ76VL5QCfXLgKLtrObX2FzbQ3XMHhAqZi
nT8An1zTWYJSmdRs30eLfDIy4LpqslRp
=80mR
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-dev]  Re: Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-17 23:52 ` Friedrich Oslage
@ 2009-01-18  7:17   ` Duncan
  2009-01-18  9:39   ` [gentoo-dev] " Peter Volkov
  2009-01-19 16:18   ` Santiago M. Mola
  2 siblings, 0 replies; 9+ messages in thread
From: Duncan @ 2009-01-18  7:17 UTC (permalink / raw
  To: gentoo-dev

Friedrich Oslage <bluebird@gentoo.org> posted 49726F21.8010004@gentoo.org,
excerpted below, on  Sun, 18 Jan 2009 00:52:01 +0100:

> Why not teach /sbin/runscript it's own version? With something like this
>  we could also do stuff depending on a specific version of openrc:

I happened to read the OP right before I headed in to work today, and 
thus had some time to think it over.  This was the exact same idea I came 
up with and was going to post it if someone hadn't, when I got back.  You 
beat me to it! =:^)

In fact, if Roy hasn't instituted something like this already upstream, 
I'd be surprised if he doesn't take the idea and run with it as well, as 
it's certainly convenient functionality to have and expose, and I can 
think of all sorts of reasons it might come in handy and no reason not to 
do 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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-17 23:52 ` Friedrich Oslage
  2009-01-18  7:17   ` [gentoo-dev] " Duncan
@ 2009-01-18  9:39   ` Peter Volkov
  2009-01-19 16:18   ` Santiago M. Mola
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Volkov @ 2009-01-18  9:39 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

В Вск, 18/01/2009 в 00:52 +0100, Friedrich Oslage пишет:
> Robin H. Johnson schrieb:
> > I'm raising this as an extension of bug 253076, but also because I see
> > the potential for danger.

> > As a long term solution, can we just consume an inode and have some file
> > like /etc/baselayout2?

What package will install this file? Also is it possible to save openrc
${PVR} inside this file? Version is required to introduce workarounds in
reliable way for openrc versions which does not work with openvz startup
scripts. Also why not call this files /etc/*openrc*?

> > To date, for an init script that has baselayout2-specific behavior, we
> > have had some variant of [ -e /lib/librc.so ] in the init script.
> >
> Why not teach /sbin/runscript it's own version? 

In some cases this will break with openvz. openvz container (CT)
start/stop scripts need to check openrc existence inside container and
depending on that generate either openrc or baselayout-1 configuration
files. This start/stop scripts work in host node (HN) environment and
since it's possible to have different versions of everything (e.g. libc)
in HN and CT /sbin/runscript will not work in some cases and thus break
networking and other things for CT.

-- 
Peter.

[-- Attachment #2: Эта часть сообщения подписана цифровой подписью --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-17 23:07 [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage Robin H. Johnson
  2009-01-17 23:52 ` Friedrich Oslage
@ 2009-01-19  3:11 ` Donnie Berkholz
  2009-01-19  6:13   ` Robin H. Johnson
  2009-01-20 14:17 ` Matthias Schwarzott
  2 siblings, 1 reply; 9+ messages in thread
From: Donnie Berkholz @ 2009-01-19  3:11 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

On 15:07 Sat 17 Jan     , Robin H. Johnson wrote:
> As a long term solution, can we just consume an inode and have some file
> like /etc/baselayout2? The file must reside on the / partition even when
> the major trees /usr, /var, /tmp, /opt, /boot, /home, /dev, /root are
> separate mountpoints.

How about using the version in /etc/gentoo-release?

comet $ cat /etc/gentoo-release 
Gentoo Base System release 2.0.0

-- 
Thanks,
Donnie

Donnie Berkholz
Developer, Gentoo Linux
Blog: http://dberkholz.wordpress.com

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-19  3:11 ` Donnie Berkholz
@ 2009-01-19  6:13   ` Robin H. Johnson
  0 siblings, 0 replies; 9+ messages in thread
From: Robin H. Johnson @ 2009-01-19  6:13 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

On Sun, Jan 18, 2009 at 07:11:52PM -0800, Donnie Berkholz wrote:
> On 15:07 Sat 17 Jan     , Robin H. Johnson wrote:
> > As a long term solution, can we just consume an inode and have some file
> > like /etc/baselayout2? The file must reside on the / partition even when
> > the major trees /usr, /var, /tmp, /opt, /boot, /home, /dev, /root are
> > separate mountpoints.
> How about using the version in /etc/gentoo-release?
I should clarify that I want to check simply the existence of a file,
rather than parse out a version number or cause a fork to execute.

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 329 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-17 23:52 ` Friedrich Oslage
  2009-01-18  7:17   ` [gentoo-dev] " Duncan
  2009-01-18  9:39   ` [gentoo-dev] " Peter Volkov
@ 2009-01-19 16:18   ` Santiago M. Mola
  2009-01-20 13:20     ` Peter Volkov
  2 siblings, 1 reply; 9+ messages in thread
From: Santiago M. Mola @ 2009-01-19 16:18 UTC (permalink / raw
  To: gentoo-dev

On Sun, Jan 18, 2009 at 12:52 AM, Friedrich Oslage <bluebird@gentoo.org> wrote:
>
> Why not teach /sbin/runscript it's own version? With something like this
>  we could also do stuff depending on a specific version of openrc:
>

That would be a good solution since it'll allow us to check higher
versions for new features. Otherwise, it's very likely that we need to
solve the same problem again in the near future.

Regards,
-- 
Santiago M. Mola
Jabber ID: cooldwind@gmail.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-19 16:18   ` Santiago M. Mola
@ 2009-01-20 13:20     ` Peter Volkov
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Volkov @ 2009-01-20 13:20 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

В Пнд, 19/01/2009 в 17:18 +0100, Santiago M. Mola пишет:
> On Sun, Jan 18, 2009 at 12:52 AM, Friedrich Oslage <bluebird@gentoo.org> wrote:
> > Why not teach /sbin/runscript it's own version? With something like this
> >  we could also do stuff depending on a specific version of openrc:
> 
> That would be a good solution since [[snip...]]

This solution does not work in some cases. See my previous mail to this
thread.

-- 
Peter.

[-- Attachment #2: Эта часть сообщения подписана цифровой подписью --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage
  2009-01-17 23:07 [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage Robin H. Johnson
  2009-01-17 23:52 ` Friedrich Oslage
  2009-01-19  3:11 ` Donnie Berkholz
@ 2009-01-20 14:17 ` Matthias Schwarzott
  2 siblings, 0 replies; 9+ messages in thread
From: Matthias Schwarzott @ 2009-01-20 14:17 UTC (permalink / raw
  To: gentoo-dev; +Cc: Robin H. Johnson

On Sonntag, 18. Januar 2009, Robin H. Johnson wrote:
> I'm raising this as an extension of bug 253076, but also because I see
> the potential for danger.
>
> To date, for an init script that has baselayout2-specific behavior, we
> have had some variant of [ -e /lib/librc.so ] in the init script.
>
> On a multilib profile with no symlinks and a 64-bit userspace, the .so
> file would be installed in /lib64/librc.so, and the check would
> mistakenly have the wrong result.
>
> There's one fix that has started to turn up already, but I'm not sure if
> it's going to be safe always: [ -f /etc/init.d/sysfs ]
> This happens to work as openrc installs that init script.
>

I changed udev to only check for /etc/init.d/sysfs. See Bug #252493.
The only place where librc checking is kept is only run on older 
openrc-versions which are no longer available via ebuild.

I hope this will make udev work on any system regardless of how /lib and stuff 
is linked. (For further analysis perhaps someone on a multilib profile can 
check where udev still has /lib/xxx hardcoded instead of /lib64/xxx or 
similar).

Should I nevertheless add such a blocker to udev or will that make update 
unnecessary complicated?
RDEPEND="!<sys-apps/openrc-0.4.0"

Regards
Matthias



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-01-20 14:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-17 23:07 [gentoo-dev] Detecting Baselayout2/openrc - no-symlink profiles leading to breakage Robin H. Johnson
2009-01-17 23:52 ` Friedrich Oslage
2009-01-18  7:17   ` [gentoo-dev] " Duncan
2009-01-18  9:39   ` [gentoo-dev] " Peter Volkov
2009-01-19 16:18   ` Santiago M. Mola
2009-01-20 13:20     ` Peter Volkov
2009-01-19  3:11 ` Donnie Berkholz
2009-01-19  6:13   ` Robin H. Johnson
2009-01-20 14:17 ` Matthias Schwarzott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox