All of lore.kernel.org
 help / color / mirror / Atom feed
* v2.29 plan: kill mtab
@ 2016-04-07 10:54 Karel Zak
  2016-04-07 11:22 ` Ruediger Meier
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Karel Zak @ 2016-04-07 10:54 UTC (permalink / raw)
  To: util-linux


libmount supports three scenarios:

 1) regular classic /etc/mtab

 2) /etc/mtab symlink to /proc/self/mount -- in this case libmount uses
    /proc/self/mountinfo and /run/mount/utab

 The current default is to detect symlink and on-the-fly switch
 between 1) and 2).

 3) --enable-libmount-force-mountinfo -- don't care about the symlink and 
    always use /proc/self/mountinfo. This is robust solution required
    for example by systemd, because unfortunately sometimes people use
    broken stuff (init scripts, tools, etc.) which removes the symlink.


 I'd like to make 3) default, the question is what with mtab code:
 
    a) #ifdef all mtab code (and add --enable-libmount-support-mtab)

    b) remove mtab support at all (because it's evil and horrible code)

 Comments?

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

* Re: v2.29 plan: kill mtab
  2016-04-07 10:54 v2.29 plan: kill mtab Karel Zak
@ 2016-04-07 11:22 ` Ruediger Meier
  2016-04-07 14:00 ` unrecognized options: --without-capng Marcus Hoffmann
  2016-04-13 20:58 ` v2.29 plan: kill mtab Ruediger Meier
  2 siblings, 0 replies; 7+ messages in thread
From: Ruediger Meier @ 2016-04-07 11:22 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Thursday 07 April 2016, Karel Zak wrote:
> libmount supports three scenarios:
>
>  1) regular classic /etc/mtab
>
>  2) /etc/mtab symlink to /proc/self/mount -- in this case libmount
> uses /proc/self/mountinfo and /run/mount/utab
>
>  The current default is to detect symlink and on-the-fly switch
>  between 1) and 2).
>
>  3) --enable-libmount-force-mountinfo -- don't care about the symlink
> and always use /proc/self/mountinfo. This is robust solution required
> for example by systemd, because unfortunately sometimes people use
> broken stuff (init scripts, tools, etc.) which removes the symlink.
>
>
>  I'd like to make 3) default, the question is what with mtab code:
>
>     a) #ifdef all mtab code (and add --enable-support-mtab)
>
>     b) remove mtab support at all (because it's evil and horrible
> code)
>
>  Comments?

Even if b) is the final goal I would first do a) and mark the new 
option --enable-support-mtab as deprecated from the beginning.

Could be interesting to see who would ever use this option and because 
of which reasons.

About changing the default: We could add a warning somewhere to a 
non-critical tool when printing human-readable output, like lsblk:
  "warning: deprecated /etc/mtab file ingnored"

... just to remind people to fix their system/scripts.

cu,
Rudi

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

* unrecognized options: --without-capng
  2016-04-07 10:54 v2.29 plan: kill mtab Karel Zak
  2016-04-07 11:22 ` Ruediger Meier
@ 2016-04-07 14:00 ` Marcus Hoffmann
  2016-04-07 16:18   ` Mike Frysinger
  2016-04-13 20:58 ` v2.29 plan: kill mtab Ruediger Meier
  2 siblings, 1 reply; 7+ messages in thread
From: Marcus Hoffmann @ 2016-04-07 14:00 UTC (permalink / raw)
  To: util-linux

Dear all,
in experimenting a bit with configure options I found the
--without-capng option (as reported by configure --help) giving the
following warning (and having no effect):
> configure: WARNING: unrecognized options: --without-capng

Looking into configure.ac I found the option should probably be named
--without-cap_ng (AC_ARG_WITH([cap_ng],...).

But using this the configure script dies with the following message:

> configure: error: conditional "HAVE_CAP_NG" was never defined.
> Usually this means the macro was only invoked conditionally.

--without-cap-ng produces the same result.

I tried fiddling around with the autoconf macros but got no further than
that.

Marcus

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

* Re: unrecognized options: --without-capng
  2016-04-07 14:00 ` unrecognized options: --without-capng Marcus Hoffmann
@ 2016-04-07 16:18   ` Mike Frysinger
  2016-04-12  9:35     ` Karel Zak
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2016-04-07 16:18 UTC (permalink / raw)
  To: Marcus Hoffmann; +Cc: util-linux


[-- Attachment #1.1: Type: text/plain, Size: 1635 bytes --]

On 07 Apr 2016 16:00, Marcus Hoffmann wrote:
> Dear all,
> in experimenting a bit with configure options I found the
> --without-capng option (as reported by configure --help) giving the
> following warning (and having no effect):
> > configure: WARNING: unrecognized options: --without-capng
> 
> Looking into configure.ac I found the option should probably be named
> --without-cap_ng (AC_ARG_WITH([cap_ng],...).

yes, the help string is wrong.  it should be:
--- a/configure.ac
+++ b/configure.ac
@@ -1182,7 +1182,7 @@ AC_CHECK_FUNCS([setns])
 
 
 AC_ARG_WITH([cap_ng],
-  AS_HELP_STRING([--without-capng], [compile without libcap-ng]),
+  AS_HELP_STRING([--without-cap-ng], [compile without libcap-ng]),
   [], [with_cap_ng=auto]
 )
 AS_IF([test "x$with_cap_ng" = xno], [have_cap_ng=no],[

> But using this the configure script dies with the following message:
> 
> > configure: error: conditional "HAVE_CAP_NG" was never defined.
> > Usually this means the macro was only invoked conditionally.
> 
> --without-cap-ng produces the same result.
> 
> I tried fiddling around with the autoconf macros but got no further than
> that.

the helper macros can sometimes obscure things

--- a/configure.ac
+++ b/configure.ac
@@ -1189,7 +1189,10 @@ AC_ARG_WITH([cap_ng],
   AS_HELP_STRING([--without-capng], [compile without libcap-ng]),
   [], [with_cap_ng=auto]
 )
-AS_IF([test "x$with_cap_ng" = xno], [have_cap_ng=no],[
+AS_IF([test "x$with_cap_ng" = xno], [
+  AM_CONDITIONAL([HAVE_CAP_NG], [false])
+  have_cap_ng=no
+],[
   UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
 ])
 
-mike

[-- Attachment #1.2: conf.patch --]
[-- Type: text/x-diff, Size: 952 bytes --]

From 110c2c94c59742e9879f2f39e6aec79925dc1592 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Thu, 7 Apr 2016 12:17:43 -0400
Subject: [PATCH] build-sys: fix cap-ng configure flag handling

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 configure.ac | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index e42a2c4..9e0e28b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1186,10 +1186,13 @@ AC_CHECK_FUNCS([setns])
 
 
 AC_ARG_WITH([cap_ng],
-  AS_HELP_STRING([--without-capng], [compile without libcap-ng]),
+  AS_HELP_STRING([--without-cap-ng], [compile without libcap-ng]),
   [], [with_cap_ng=auto]
 )
-AS_IF([test "x$with_cap_ng" = xno], [have_cap_ng=no],[
+AS_IF([test "x$with_cap_ng" = xno], [
+  AM_CONDITIONAL([HAVE_CAP_NG], [false])
+  have_cap_ng=no
+],[
   UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
 ])
 
-- 
2.7.4


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

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

* Re: unrecognized options: --without-capng
  2016-04-07 16:18   ` Mike Frysinger
@ 2016-04-12  9:35     ` Karel Zak
  0 siblings, 0 replies; 7+ messages in thread
From: Karel Zak @ 2016-04-12  9:35 UTC (permalink / raw)
  To: Marcus Hoffmann, util-linux

On Thu, Apr 07, 2016 at 12:18:02PM -0400, Mike Frysinger wrote:
>  configure.ac | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Applied, thanks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

* Re: v2.29 plan: kill mtab
  2016-04-07 10:54 v2.29 plan: kill mtab Karel Zak
  2016-04-07 11:22 ` Ruediger Meier
  2016-04-07 14:00 ` unrecognized options: --without-capng Marcus Hoffmann
@ 2016-04-13 20:58 ` Ruediger Meier
  2016-04-14 12:43   ` Karel Zak
  2 siblings, 1 reply; 7+ messages in thread
From: Ruediger Meier @ 2016-04-13 20:58 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Thursday 07 April 2016, Karel Zak wrote:
> libmount supports three scenarios:
>
>  1) regular classic /etc/mtab
>
>  2) /etc/mtab symlink to /proc/self/mount -- in this case libmount
> uses /proc/self/mountinfo and /run/mount/utab
>
>  The current default is to detect symlink and on-the-fly switch
>  between 1) and 2).
>
>  3) --enable-libmount-force-mountinfo -- don't care about the symlink
> and always use /proc/self/mountinfo. This is robust solution required
> for example by systemd, because unfortunately sometimes people use
> broken stuff (init scripts, tools, etc.) which removes the symlink.
>
>
>  I'd like to make 3) default, the question is what with mtab code:
>
>     a) #ifdef all mtab code (and add --enable-libmount-support-mtab)
>
>     b) remove mtab support at all (because it's evil and horrible
> code)
>
>  Comments?
>
>     Karel


What about this first step:

>From e6c17f35a8d63f129c5bbd722995b97d050e4151 Mon Sep 17 00:00:00 2001
From: Ruediger Meier <ruediger.meier@ga-group.nl>
Date: Wed, 13 Apr 2016 22:33:06 +0200
Subject: [PATCH] libmount: deprecate /etc/mtab file

Default is now --enable-libmount-force-mountinfo.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 31a1911..e4e6996 100644
--- a/configure.ac
+++ b/configure.ac
@@ -958,8 +958,8 @@ AC_SUBST([LIBMOUNT_VERSION_INFO])
 AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string])

 AC_ARG_ENABLE([libmount-force-mountinfo],
-  AS_HELP_STRING([--enable-libmount-force-mountinfo], [ignore /etc/mtab in all situations (recommended for systemd)]),
-  [], [enable_libmount_force_mountinfo=no]
+  AS_HELP_STRING([--disable-libmount-force-mountinfo], [use deprecated /etc/mtab file (not recommended and incompatible with openrc or systemd)]),
+  [], [enable_libmount_force_mountinfo=yes]
 )

 AS_IF([test "x$enable_libmount_force_mountinfo" == xyes], [
--
1.8.4.5

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

* Re: v2.29 plan: kill mtab
  2016-04-13 20:58 ` v2.29 plan: kill mtab Ruediger Meier
@ 2016-04-14 12:43   ` Karel Zak
  0 siblings, 0 replies; 7+ messages in thread
From: Karel Zak @ 2016-04-14 12:43 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: util-linux

On Wed, Apr 13, 2016 at 10:58:28PM +0200, Ruediger Meier wrote:
> On Thursday 07 April 2016, Karel Zak wrote:
> > libmount supports three scenarios:
> >
> >  1) regular classic /etc/mtab
> >
> >  2) /etc/mtab symlink to /proc/self/mount -- in this case libmount
> > uses /proc/self/mountinfo and /run/mount/utab
> >
> >  The current default is to detect symlink and on-the-fly switch
> >  between 1) and 2).
> >
> >  3) --enable-libmount-force-mountinfo -- don't care about the symlink
> > and always use /proc/self/mountinfo. This is robust solution required
> > for example by systemd, because unfortunately sometimes people use
> > broken stuff (init scripts, tools, etc.) which removes the symlink.
> >
> >
> >  I'd like to make 3) default, the question is what with mtab code:
> >
> >     a) #ifdef all mtab code (and add --enable-libmount-support-mtab)
> >
> >     b) remove mtab support at all (because it's evil and horrible
> > code)
> >
> >  Comments?
> >
> >     Karel
> 
> 
> What about this first step:

I have applied another patch to disable mtab by default, a new 
configure option

    --enable-libmount-support-mtab 
    
is necessary to enable the original behavior.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2016-04-14 12:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-07 10:54 v2.29 plan: kill mtab Karel Zak
2016-04-07 11:22 ` Ruediger Meier
2016-04-07 14:00 ` unrecognized options: --without-capng Marcus Hoffmann
2016-04-07 16:18   ` Mike Frysinger
2016-04-12  9:35     ` Karel Zak
2016-04-13 20:58 ` v2.29 plan: kill mtab Ruediger Meier
2016-04-14 12:43   ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.