[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Alejandro Colomar
Subject: Re: [BUG] inconsistency in $localstatedir and $runstatedir
Date: Mon, 18 Jul 2022 10:33:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

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:

      Should normally be */usr/local*

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

      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?



Alejandro Colomar

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]