Menu

#529 configuration directory can't be modified [patch]

GC 3.0
open
None
5 - default
2020-11-12
2018-06-19
No
./configure --help

states that there is an --sysconfdir

  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]

But using this option has no effect.

Autotools recommends that the config files should be placed in $prefix/etc
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html

On Linux systems, configuration files have to be either in /usr/local/etc (local build) on in /etc (package install)
https://refspecs.linuxfoundation.org/fhs.shtml

Please allow the user to change the configuration directory.

The following patch is effective only with Linux systems (on purpose).

1 Attachments

Related

Wish List: #342

Discussion

  • Simon Sobisch

    Simon Sobisch - 2018-07-20
    • assigned_to: Edward Hart
    • Group: unclassified --> GC 3.0
     
  • Simon Sobisch

    Simon Sobisch - 2018-07-20

    Assigned to Edward for rechecking and commiting.

     
  • Edward Hart

    Edward Hart - 2018-07-23

    We have an issue with compiler configuration files and runtime configuration files. Compiler configuration files are read-only and architecture independent. Runtime configuration files are probably made for particular machines (but should in principle be architecture independent). Would this affect the choice of $sysconfdir v. $datadir? Should the two types of configuration files be installed to separate directories?

     

    Last edit: Edward Hart 2018-07-23
  • Simon Sobisch

    Simon Sobisch - 2018-09-24
    • assigned_to: Edward Hart --> James K. Lowden
     
  • Simon Sobisch

    Simon Sobisch - 2018-09-24

    Will be changed to @datadir@ along with the changes for [feature-requests:#342] which should fix this issue.

     

    Related

    Wish List: #342

  • Simon Sobisch

    Simon Sobisch - 2020-11-12

    @jklowden Do you agree that this can be closed now?

     
    • James K. Lowden

      James K. Lowden - 2020-11-12

      I see no evidence --sysconfdir=DIR has any effect in 3.1:

      $ head config.log 
      This file contains any messages produced by compilers while
      running configure, to aid debugging if configure makes a mistake.
      
      It was created by GnuCOBOL configure 3.1, which was
      generated by GNU Autoconf 2.69.  Invocation command line was
      
        $ ../configure --prefix=/usr/local/cobol/cobc.3.x \
              --sysconfdir=/usr/local/cobol/cobc.3.x/sysconfdir
      

      [I added the trailing backslash for clarity.]

      $ make install > log
      
      $ ls /usr/local/cobol/cobc.3.x/sysconfdir
      ls: cannot access '/usr/local/cobol/cobc.3.x/sysconfdir': 
            No such file or directory
      

      $ grep default.conf log

      /usr/bin/install -c -m 644 ../../config/default.conf ../../config/cobol85.conf ../../config/cobol2002.conf ../../config/cobol2014.conf ../../config/acu.conf ../../config/mf.conf ../../config/ibm.conf ../../config/mvs.conf ../../config/bs2000.conf ../../config/realia.conf ../../config/rm.conf ../../config/acu-strict.conf ../../config/mf-strict.conf ../../config/ibm-strict.conf ../../config/mvs-strict.conf ../../config/bs2000-strict.conf ../../config/realia-strict.conf ../../config/rm-strict.conf ../../config/xopen.conf ../../config/lax.conf-inc ../../config/cobol85.words ../../config/cobol2002.words ../../config/cobol2014.words ../../config/acu.words ../../config/mf.words ../../config/ibm.words ../../config/mvs.words ../../config/bs2000.words ../../config/realia.words ../../config/rm.words ../../config/runtime.cfg ../../config/runtime_empty.cfg '/usr/local/cobol/cobc.3.x/share/gnucobol/config'

      The directory specified is not created, no error message is produced, and files I would expect to be placed in sysconfigdir are instead installed to PREFIX/share/gnucobol/config.

      [update]

      $ ls /usr/local/cobol/cobc.3.x/
      bin  include  lib  share
      

      No etc directory is created. It should be, and share is being misused.

      The etc directory holds machine-specific configuration information. Files in that directory are meant to be edited by the administrator (or user). The share directory, by contrast, is read-only: it is data used/provided by applications including, for example, documentation.

      The files in PREFIX/share/gnucobol/config belong in PREFIX/etc/gnucobol/config (by default) because they are user-modifiable. The conventional approach would support per-user overrides in $HOME/.gnucobol/config.

       

      Last edit: James K. Lowden 2020-11-12
      • Simon Sobisch

        Simon Sobisch - 2020-11-12

        Correct. We never installed anything to sysconfigdir, but now use the datadir correctly so that should be the option to adjust that [which would fix what the title is about], if you don't change anything it is installed in the same place as before.

        But with 4.0 we could also adjust the place that we install too.
        Can you have a look at https://www.gnu.org/prep/standards/html_node/Directory-Variables.html and where we currently install stuff to suggest which files to possibly store in a different place to the dev-group for discussion?

         

Log in to post a comment.

MongoDB Logo MongoDB