bug-gnunet
[Top][All Lists]
Advanced

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

Re: [bug-GNUnet] Can't specify different names for config file in projec


From: Alessio Vanni
Subject: Re: [bug-GNUnet] Can't specify different names for config file in project data
Date: Wed, 11 Sep 2019 18:00:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Christian Grothoff <address@hidden> writes:

> Ok, then I'm not sure how you expect this to work: if you do not give
> the code access to the configuration data (i.e. by telling it to load it
> from a different directory than where GNUnet was installed and also not
> providing the right configuration information in that directory), then
> obviously the logic will fail when it needs its configuration.
>
> Note that you can use GNUNET_CONFIGURATION_load* with the "right"
> path(s) to manually load either the GNUnet configuration data or your
> own applications' configuration data (if they are in different
> locations). However, without such manual action on your part,
> libgnunetutil will by design only load the configuration data from the
> one location that is configured via the ProjectData mechanism.
>
> Does this help?

I'm not sure if I understood correctly what you mean, so let me list
what I know about how configuration works.  It might be wrong and that's
why I'm doing this.

When I define the ProjectData structure, I specify that I want my
application to look for a certain configuration file.  Because I want
this file to be specific to my application, I don't use the GNUnet's
file, but something else (say, "test-program.conf" and
"~/.test-program.d/config")

Before reading that file (if it exists), GNUnet searches a standard
location for a default configuration, which is the "config.d" directory
inside the GNUNET_OS_IPK_DATADIR directory.

That directory is found by using the ".project_dirname" field of the
ProjectData structure, so if that field is "test-program", the
GNUNET_OS_IPK_DATADIR directory would be "share/test-program/config.d/".

The configuration loader will load any file that is inside that
directory and then it will load the config file provided by
".config_file" or ".user_config_file".

Because that directory is not GNUnet's directory, anything specific to
GNUnet is not loaded.  The problem with this is that the application is
then unable to find the port/socket needed to connect with GNUnet's
services.

Calling the loader on the config files specified by the default
ProjectData or simply not changing those two field in the structure does
not really solve it: if the file is empty (the tutorial on the website
itself says it's fine to have an empty gnunet.conf) the default values
are still not loaded as they are located in "share/gnunet/config.d"
which is never scanned by GNUnet.

Ultimately what I'm expecting is that on initialization the application
loads GNUnet's settings (mainly to find the services' port/sockets) and
then its own settings.  Is that a wrong assumption to make?

Thanks,
A.V.



reply via email to

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