$(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
###############################################################################
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
#
-# 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
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
%{_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
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 */
/*
- * Cell server database parser.
+ * kAFS config and cell database parser.
*
* Copyright (C) David Howells (dhowells@redhat.com) 2018
*
/*
* 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);
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);
#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 { \
}
/*
- * 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;
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);
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);