]> www.infradead.org Git - users/dhowells/kafs-client.git/commitdiff
Change config to /etc/kafs/client.{conf,d}
authorDavid Howells <dhowells@redhat.com>
Mon, 10 Dec 2018 22:04:32 +0000 (22:04 +0000)
committerDavid Howells <dhowells@redhat.com>
Tue, 11 Dec 2018 00:23:09 +0000 (00:23 +0000)
Change the name of the config file and dir to /etc/kafs/client.{conf,d} rather
than /etc/kafs/cellservdb.*.

Note that the default cellservdb.conf is unrenamed and is included by
client.conf.

Signed-off-by: David Howells <dhowells@redhat.com>
Makefile
conf/etc.conf
redhat/kafs-client.spec
src/dns_main.c
src/include/kafs/cellserv.h
src/kafs-check-config.c
src/lib_cell_lookup.c
src/preload-cells.c

index 3f9b55cdf97db8dc4ce07137d48e553b2339e305..9c6a89773a2ed9a23dba41ee57060d0644eb2420 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -56,11 +56,11 @@ install: all
        $(INSTALL) -D -m 0644 man/aklog-kafs.1 $(DESTDIR)$(MAN1)/aklog-kafs.1
        $(INSTALL) -D -m 0644 man/aklog.1 $(DESTDIR)$(MAN1)/aklog.1
        $(INSTALL) -D -m 0644 conf/cellservdb.conf $(DESTDIR)$(DATADIR)/cellservdb.conf
-       $(INSTALL) -D -m 0644 conf/etc.conf $(DESTDIR)$(ETCDIR)/kafs/cellservdb.conf
+       $(INSTALL) -D -m 0644 conf/etc.conf $(DESTDIR)$(ETCDIR)/kafs/client.conf
        $(INSTALL) -D -m 0644 conf/kafs_dns.conf $(DESTDIR)$(ETCDIR)/request-key.d/kafs_dns.conf
        $(INSTALL) -D -m 0644 conf/kafs-config.service $(DESTDIR)$(UNITDIR)/kafs-config.service
        $(INSTALL) -D -m 0644 conf/afs.mount $(DESTDIR)$(UNITDIR)/afs.mount
-       $(MKDIR) -m755 $(DESTDIR)$(ETCDIR)/kafs/cellservdb.d
+       $(MKDIR) -m755 $(DESTDIR)$(ETCDIR)/kafs/client.d
        $(MKDIR) -m755 $(DESTDIR)/afs
 
 ###############################################################################
@@ -97,9 +97,10 @@ ZSRCBALL := rpmbuild/SOURCES/$(ZTARBALL)
 
 BUILDID        := .local
 dist   := $(word 2,$(shell grep -r "^%dist" /etc/rpm /usr/lib/rpm))
-release        := $(word 2,$(shell grep ^Release: $(SPECFILE)))
-release        := $(subst %{?dist},$(dist),$(release))
-release        := $(subst %{?buildid},$(BUILDID),$(release))
+release3:= $(word 2,$(shell grep ^Release: $(SPECFILE)))
+release2:= $(subst %{?dist},$(dist),$(release3))
+release1:= $(subst %{?buildid},$(BUILDID),$(release2))
+release        := $(subst %{?distprefix},,$(release1))
 rpmver := $(VERSION)-$(release)
 SRPM   := rpmbuild/SRPMS/kafs-client-$(rpmver).src.rpm
 
index 11e144a191cba98817333e8b04bdd45d6e5609a5..d0ebfa552a4ee32522add0b92f3c9b4d5694d58f 100644 (file)
@@ -1,6 +1,6 @@
 #
-# This file stitches together the local kAFS cell database, which can be
-# placed in the cellservdb.d/ directory, with the generic database.
+# This file stitches together the local kAFS configuration and cell database,
+# which can be placed in the client.d/ directory, with the generic database.
 #
-includedir /etc/kafs/cellservdb.d
+includedir /etc/kafs/client.d
 include /usr/share/kafs/cellservdb.conf
index 79aec9f09e538797341eb82340f7641b5c159746..083a33580e6fc06f6dff7dba9024a95aa7829221 100644 (file)
@@ -15,9 +15,8 @@ BuildRequires: keyutils-libs-devel
 BuildRequires: openssl-devel
 
 #
-# Need this for the upcall program to do DNS lookups.  v1.5.11 can read the
-# kAFS config files:
-#      /etc/kafs/cellservdb.conf
+# Need this for the upcall program to do DNS lookups.
+#      /etc/kafs/client.conf
 #
 %global datadir %{_datarootdir}/kafs
 
@@ -129,8 +128,8 @@ ln -s aklog-kafs %{buildroot}/%{_bindir}/aklog
 %{_libdir}/libkafs_client.so.%{libapiversion}
 %{_libdir}/libkafs_client.so.%{libapivermajor}
 %{datadir}
-%config(noreplace) %{_sysconfdir}/kafs/cellservdb.conf
-%config(noreplace) %{_sysconfdir}/kafs/cellservdb.d
+%config(noreplace) %{_sysconfdir}/kafs/client.conf
+%config(noreplace) %{_sysconfdir}/kafs/client.d
 
 %files libs-devel
 %{_libdir}/libkafs_client.so
index 0580d3ac95dde7c8431f5b6d23237998bbd6fc5b..2c1e5a31e97e712b21c540267255b72c69d2b9a5 100644 (file)
@@ -365,7 +365,7 @@ int main(int argc, char *argv[])
        if (kafs_init_lookup_context(&ctx) < 0)
                exit(1);
 
-       if (kafs_init_celldb(filep, &ctx.report) < 0)
+       if (kafs_read_config(filep, &ctx.report) < 0)
                exit(ctx.report.bad_config ? 3 : 1);
 
        /* Generate the payload */
index c48acf04583c262fc54339c8d7e420b5f1029dd4..eec8379253d35321c5fcfc80c68e5d4bcab37269 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Cell server database parser.
+ * kAFS config and cell database parser.
  *
  * Copyright (C) David Howells (dhowells@redhat.com) 2018
  *
@@ -144,9 +144,9 @@ extern int kafs_dns_lookup_vlservers(struct kafs_server_list *vsl,
 /*
  * cell_lookup.c
  */
+extern struct kafs_profile kafs_config_profile;
 extern struct kafs_cell_db *kafs_cellserv_db;
-extern struct kafs_profile kafs_cellserv_profile;
-extern int kafs_init_celldb(const char *const *files,
+extern int kafs_read_config(const char *const *files,
                            struct kafs_report *report);
 extern struct kafs_cell *kafs_lookup_cell(const char *cell_name,
                                          struct kafs_lookup_context *ctx);
index ddb5a7098d7ee3b2ae4e6c06569d16faf67f15d6..6703db5256ce8b59533d45953ea26d6c6405016e 100644 (file)
@@ -132,11 +132,11 @@ int main(int argc, char *argv[])
        if (kafs_init_lookup_context(&ctx) < 0)
                exit(1);
 
-       if (kafs_init_celldb(filep, &ctx.report) < 0)
+       if (kafs_read_config(filep, &ctx.report) < 0)
                exit(ctx.report.bad_config ? 3 : 1);
 
        if (dump_profile)
-               kafs_profile_dump(&kafs_cellserv_profile, 0);
+               kafs_profile_dump(&kafs_config_profile, 0);
        if (dump_db)
                kafs_cellserv_dump(kafs_cellserv_db);
 
index 6240bb660a19ca0d56a648aabe3b47b6b41899f2..65a9a4b47dac2c2c7350f8cab156c78feda8751b 100644 (file)
 #include <kafs/cellserv.h>
 #include <kafs/profile.h>
 
-static const char *const kafs_std_cellservdb[] = {
-       ETCDIR "/kafs/cellservdb.conf",
+static const char *const kafs_std_config[] = {
+       ETCDIR "/kafs/client.conf",
        NULL
 };
 
+struct kafs_profile kafs_config_profile = { .name = "<kafsconfig>" };
 struct kafs_cell_db *kafs_cellserv_db;
-struct kafs_profile kafs_cellserv_profile = { .name = "<cellservdb>" };
 
 #define verbose(r, fmt, ...)                                           \
        do {                                                            \
@@ -54,19 +54,19 @@ error:
 }
 
 /*
- * Initialise the cell database.
+ * Read the configuration and initialise the cell database.
  */
-int kafs_init_celldb(const char *const *files, struct kafs_report *report)
+int kafs_read_config(const char *const *files, struct kafs_report *report)
 {
 
        if (!files)
-               files = kafs_std_cellservdb;
+               files = kafs_std_config;
 
        for (; *files; files++)
-               if (kafs_profile_parse_file(&kafs_cellserv_profile, *files, report) == -1)
+               if (kafs_profile_parse_file(&kafs_config_profile, *files, report) == -1)
                        return -1;
 
-       kafs_cellserv_db = kafs_cellserv_parse_conf(&kafs_cellserv_profile, report);
+       kafs_cellserv_db = kafs_cellserv_parse_conf(&kafs_config_profile, report);
        if (!kafs_cellserv_db)
                return -1;
 
@@ -130,7 +130,7 @@ struct kafs_cell *kafs_lookup_cell(const char *cell_name,
        struct kafs_cell *cell;
        unsigned int i, j;
 
-       if (!kafs_cellserv_db && kafs_init_celldb(NULL, &ctx->report) < 0)
+       if (!kafs_cellserv_db && kafs_read_config(NULL, &ctx->report) < 0)
                return NULL;
 
        cell = kafs_alloc_cell(cell_name, ctx);
index 4199f60fbf2965b4ed2844d0a351dff124b62630..ab308e37780f6ba755e25c63ab3e7ad37d39ddd9 100644 (file)
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
        if (argc > 0)
                files = (const char **)argv;
 
-       if (kafs_init_celldb(files, &report) < 0)
+       if (kafs_read_config(files, &report) < 0)
                exit(3);
 
        do_preload(kafs_cellserv_db, redirect_to_stdout);