Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Alejandro Colomar

Hi Alfred,

On 7/18/22 13:51, Alfred M. Szmidt wrote:

So you're saying that "should normally be" doesn't mean the "the
default value should normally be", but rather that "commonly,
people use".

Right, the _default_ value depends on _your_ system.  On some systems,
it is one thing, and on other it is something else.

Which is why "you" (you in the sense, you or your distribution) should
have a config.site that specifies the correct thing for your system.

So maybe you would like to change it to something like:

[
This should normally be /var/run, but the default value should be
/usr/local/var/run, but write it as $(localstatedir)/run
]


Or even omit any reference to /var/run, which is just misleading, and say:

[
This should normally be /usr/local/var/run, but write it as
$(localstatedir)/run
]

Makes sense?

Not at all, since we really want it to be /var/run not something else,
but the default is different.  So we want it to be /var/run, but it is
set to localstatedir/run for "special" reasons.

I don't see why we would like to mention /var/run here if we don't
mention for example /etc (we mention /usr/local/etc).

Because for "locally" installed software, the location is
/usr/local/etc -- not /etc.  /var/run is special.


Okay, so it's kind of "the default $runstatedir is $localstatedir/run 
but never use it; always set it to runstatedir=/var/run (or /run) at 
compile time".


If so, I think it needs some more words about it.

Cheers,

Alex

--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Alfred M. Szmidt
   So you're saying that "should normally be" doesn't mean the "the
   default value should normally be", but rather that "commonly,
   people use".

Right, the _default_ value depends on _your_ system.  On some systems,
it is one thing, and on other it is something else.

Which is why "you" (you in the sense, you or your distribution) should
have a config.site that specifies the correct thing for your system.

   So maybe you would like to change it to something like:

   [
   This should normally be /var/run, but the default value should be 
   /usr/local/var/run, but write it as $(localstatedir)/run
   ]


   Or even omit any reference to /var/run, which is just misleading, and say:

   [
   This should normally be /usr/local/var/run, but write it as 
   $(localstatedir)/run
   ]

   Makes sense?

Not at all, since we really want it to be /var/run not something else,
but the default is different.  So we want it to be /var/run, but it is
set to localstatedir/run for "special" reasons.

   I don't see why we would like to mention /var/run here if we don't 
   mention for example /etc (we mention /usr/local/etc).

Because for "locally" installed software, the location is
/usr/local/etc -- not /etc.  /var/run is special.



Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Alfred M. Szmidt


   Hi Alejandro,

   I think the source of the confusion is that "Should normally be" and how
   you should write a default value don't match up because it is normal to
   use non-default values.

   So systems are commonly set up with localstatedir=/usr/var and
   runstatedir=/var/run, despite the fact that their defaults are
   $prefix/var and the result of appending /run to it.  The reason to give
   the defaults in this form is so that, when someone sets prefix to
   /usr/local, they (by default) get /usr/local/var and /usr/local/var/run
   and thus conform to "how your non-system GNU install should work" rather
   than stomping on where things would have been if you'd hard-coded what
   many folk do in fact set up.  This way, if someone sets things up
   differently, you play nicely with their choices, rather than hard-coding
   what "everyone" else does.

   It's about whoever administers a particular box being at liberty to do
   what they want, so if you're writing software to offer to others to
   install on their systems, your defaults should be "polite" and not
   impose on them any particular set-up.

Well written.



Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Alejandro Colomar

Hi Edward,

On 7/18/22 12:25, Edward Welbourne wrote:

Hi Alejandro,

I think the source of the confusion is that "Should normally be" and how
you should write a default value don't match up because it is normal to
use non-default values.

So systems are commonly set up with localstatedir=/usr/var and
runstatedir=/var/run, despite the fact that their defaults are
$prefix/var and the result of appending /run to it.  The reason to give
the defaults in this form is so that, when someone sets prefix to
/usr/local, they (by default) get /usr/local/var and /usr/local/var/run
and thus conform to "how your non-system GNU install should work" rather
than stomping on where things would have been if you'd hard-coded what
many folk do in fact set up.  This way, if someone sets things up
differently, you play nicely with their choices, rather than hard-coding
what "everyone" else does.

It's about whoever administers a particular box being at liberty to do
what they want, so if you're writing software to offer to others to
install on their systems, your defaults should be "polite" and not
impose on them any particular set-up.

Does that make it clearer ?


I think so.

So you're saying that "should normally be" doesn't mean the "the default 
value should normally be", but rather that "commonly, people use".


That is not obvious at all from reading the file, since that entry is 
the only one in which "should normally be" is different than the default 
value (AFAIR).  Also, the wording is not helping:


"This [$runstatedir] should normally be /var/run, but write it as 
$(localstatedir)/run"


"write it as" to me means that the "written" version has the same 
meaning as the former (and happens to be in all other entries).


So maybe you would like to change it to something like:

[
This should normally be /var/run, but the default value should be 
/usr/local/var/run, but write it as $(localstatedir)/run

]

Or even omit any reference to /var/run, which is just misleading, and say:

[
This should normally be /usr/local/var/run, but write it as 
$(localstatedir)/run

]

Makes sense?

I don't see why we would like to mention /var/run here if we don't 
mention for example /etc (we mention /usr/local/etc).



Thanks,

Alex

--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Edward Welbourne
Hi Alejandro,

I think the source of the confusion is that "Should normally be" and how
you should write a default value don't match up because it is normal to
use non-default values.

So systems are commonly set up with localstatedir=/usr/var and
runstatedir=/var/run, despite the fact that their defaults are
$prefix/var and the result of appending /run to it.  The reason to give
the defaults in this form is so that, when someone sets prefix to
/usr/local, they (by default) get /usr/local/var and /usr/local/var/run
and thus conform to "how your non-system GNU install should work" rather
than stomping on where things would have been if you'd hard-coded what
many folk do in fact set up.  This way, if someone sets things up
differently, you play nicely with their choices, rather than hard-coding
what "everyone" else does.

It's about whoever administers a particular box being at liberty to do
what they want, so if you're writing software to offer to others to
install on their systems, your defaults should be "polite" and not
impose on them any particular set-up.

Does that make it clearer ?

Eddy.



Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Alejandro Colomar



On 7/18/22 11:17, Alfred M. Szmidt wrote:

Oh, there _is_ a bug.  Compare what the documentation says, with a bit
of variable expansion that I did to show the bug (between parentheses):

Documentation says:

   $prefix
  Should normally be */usr/local*

   $localstatedir
  Should normally be */usr/local/var*
  But write it as *$prefix/var* (= /usr/local/var; OK)

   $runstatedir
  Should normally be */var/run*
  But write it as *$localstatedir/run* (=  $prefix/var/run)
   (=  /usr/local/var/run)
   (!= /var/run; NOK)

Do you realize the bug now?

This is intended and not a bug, "should normally" doesn't mean that it
is, or must be.  *You* are _supposed_ to pass the right thing for your
system, the defaults are (i.e. localstatedir = runstatedir) is to make


No, the defaults are not localstatedir = runstatedir.
runstatedir is $localstatedir/run, AFAICR.


it easy for people just doing a "default" install, but if your system
has someting else, you need to modify it (i,e., the 'should be').


I don't want something else.  I want the defaults.



So not a bug, but intended behaivour.


Disagree.  I'll quote exact wording of the coding standards:

"$(localstatedir) should normally be /usr/local/var, but write it as 
$(prefix)/var"
"This [$runstatedir] should normally be /var/run, but write it as 
$(localstatedir)/run"


It is saying "/var/run" should be written as $localstatedir/run, but 
that is not possible.  Remember that $localstatedir is /usr/local/var in 
the "default" set of directories.


I know I can set $runstatedir explicitly for my system, but defaults are 
there so that I don't need to do it as long as I want to use the 
defaults.  The thing is the defaults are broken.


Or am I wrong in assuming that the wording "should normally be" means 
that that is the default value for GNU Makefiles?  I don't think so.


Cheers,

Alex

--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Alfred M. Szmidt
   Oh, there _is_ a bug.  Compare what the documentation says, with a bit 
   of variable expansion that I did to show the bug (between parentheses):

   Documentation says:

  $prefix
  Should normally be */usr/local*

  $localstatedir
  Should normally be */usr/local/var*
  But write it as *$prefix/var* (= /usr/local/var; OK)

  $runstatedir
  Should normally be */var/run*
  But write it as *$localstatedir/run* (=  $prefix/var/run)
   (=  /usr/local/var/run)
   (!= /var/run; NOK)

   Do you realize the bug now?

This is intended and not a bug, "should normally" doesn't mean that it
is, or must be.  *You* are _supposed_ to pass the right thing for your
system, the defaults are (i.e. localstatedir = runstatedir) is to make
it easy for people just doing a "default" install, but if your system
has someting else, you need to modify it (i,e., the 'should be').

So not a bug, but intended behaivour.



Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-18 Thread Alejandro Colomar

Hi Alfred,

On 7/17/22 16:18, Alfred M. Szmidt wrote:

How can $localstatedir be $prefix/var and at the same time $runstatedir
be /var/run (notice no prefix) if it is defined as $localstatedir/run.

Because prefix is normally /usr, and it was/is common to use /usr/var
for exactly that purpose.  Where as runstatedir was in /var/run and
not /usr.

Since the FHS doesn't define /usr/local/var, and my Debian system lacks
it, and I don't think people are going to start symlinking
/usr/local/var to /var, I guess the coding standard really intended to
define $localstatedir as /var.

Yes, and no.  On GNU/Linux, it was meant to be /usr/var (prefix =
"/usr"), on GNU systems it was meant to be /var (prefix = "")

If you want to do this on other systems, the best way is to setup a
config.site file where you specify the locations explisltly.

The bug is also present in the GNU Make documentation, which seems to be
just a copy of the GNU coding standards.

This isn't a bug, it works as intended.


Oh, there _is_ a bug.  Compare what the documentation says, with a bit 
of variable expansion that I did to show the bug (between parentheses):


Documentation says:

  $prefix
  Should normally be */usr/local*

  $localstatedir
  Should normally be */usr/local/var*
  But write it as *$prefix/var* (= /usr/local/var; OK)

  $runstatedir
  Should normally be */var/run*
  But write it as *$localstatedir/run* (=  $prefix/var/run)
   (=  /usr/local/var/run)
   (!= /var/run; NOK)

Do you realize the bug now?

Cheers,

Alex

--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-17 Thread Alfred M. Szmidt
   How can $localstatedir be $prefix/var and at the same time $runstatedir 
   be /var/run (notice no prefix) if it is defined as $localstatedir/run.

Because prefix is normally /usr, and it was/is common to use /usr/var
for exactly that purpose.  Where as runstatedir was in /var/run and
not /usr.

   Since the FHS doesn't define /usr/local/var, and my Debian system lacks 
   it, and I don't think people are going to start symlinking 
   /usr/local/var to /var, I guess the coding standard really intended to 
   define $localstatedir as /var.

Yes, and no.  On GNU/Linux, it was meant to be /usr/var (prefix =
"/usr"), on GNU systems it was meant to be /var (prefix = "")

If you want to do this on other systems, the best way is to setup a
config.site file where you specify the locations explisltly.

   The bug is also present in the GNU Make documentation, which seems to be 
   just a copy of the GNU coding standards.

This isn't a bug, it works as intended.




Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-15 Thread Alejandro Colomar (man-pages)

Hi Paul,

On 7/14/22 18:11, Paul Smith wrote:

On Thu, 2022-07-14 at 14:16 +0200, Alejandro Colomar wrote:

How can $localstatedir be $prefix/var and at the same time
$runstatedir be /var/run (notice no prefix) if it is defined as
$localstatedir/run.


This I don't know about: it might be a problem in the description.


Since the FHS doesn't define /usr/local/var, and my Debian system
lacks it, and I don't think people are going to start symlinking
/usr/local/var to /var, I guess the coding standard really intended
to define $localstatedir as /var.


No, I don't think this is the case.  The GNU standards assume that all
software is installed into /usr/local by default, and that would assume
/usr/local/var.

If you want your software installed into "system" directories such as
/usr/bin, /var, /lib, etc. instead of /usr/local then you're expected
to reset these values yourself to what you want them to be when you
configure the software.


I want to use /usr/local.  Not "system directories".  I was just trying 
to use the correct paths, and found some broken docs about it, and had a 
guess :)




The runstatedir is a special case because it's a system-managed
directory (in that the system will clean it), which is usually shared
by all services regardless of where they're installed.  Unless the
system is supposed to also manage /usr/local/run or similar?  I hadn't
heard that but I've not checked.


Hmm, it makes sense.  /usr/local/var is persistent stuff, so should be 
in /usr/local for sure.


/var/run isn't, and so it can live there.

So, either the description should be fixed so that $runstatedir doesn't 
depend on $localstatedir, or so that it is /usr/local/var/run.  I don't 
know which one should be preferred.  Maybe using /usr/local/var/run is 
better, because it allows symlinking to /var/run/local or /var/run 
depending on preferences.


Cheers,

Alex

--
Alejandro Colomar
Linux man-pages comaintainer; http://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



Re: [BUG] inconsistency in $localstatedir and $runstatedir

2022-07-14 Thread Paul Smith
On Thu, 2022-07-14 at 14:16 +0200, Alejandro Colomar wrote:
> How can $localstatedir be $prefix/var and at the same time
> $runstatedir be /var/run (notice no prefix) if it is defined as
> $localstatedir/run.

This I don't know about: it might be a problem in the description.

> Since the FHS doesn't define /usr/local/var, and my Debian system
> lacks it, and I don't think people are going to start symlinking 
> /usr/local/var to /var, I guess the coding standard really intended
> to define $localstatedir as /var.

No, I don't think this is the case.  The GNU standards assume that all
software is installed into /usr/local by default, and that would assume
/usr/local/var.

If you want your software installed into "system" directories such as
/usr/bin, /var, /lib, etc. instead of /usr/local then you're expected
to reset these values yourself to what you want them to be when you
configure the software.

The runstatedir is a special case because it's a system-managed
directory (in that the system will clean it), which is usually shared
by all services regardless of where they're installed.  Unless the
system is supposed to also manage /usr/local/run or similar?  I hadn't
heard that but I've not checked.