From 63f69b9ccb37f95ff628b95cd4e1ea6e6bcf0c00 Mon Sep 17 00:00:00 2001 From: "sean.hefty@intel.com" Date: Tue, 3 Apr 2012 11:38:12 -0700 Subject: [PATCH] Refresh of daemonize --- Makefile.am | 3 +++ linux/osd.h | 3 ++- src/acm.c | 8 ++++---- src/acme.c | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4ede5ae..58e3415 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,9 @@ install-exec-hook: if ! test -d $(DESTDIR)$(sysconfdir); then \ mkdir -p $(DESTDIR)$(sysconfdir); \ fi; \ + if ! test -d $(DESTDIR)$(sysconfdir)/rdma; then \ + mkdir -p $(DESTDIR)$(sysconfdir)/rdma; \ + fi; \ if ! test -d $(DESTDIR)$(sysconfdir)/init.d; then \ mkdir -p $(DESTDIR)$(sysconfdir)/init.d; \ fi; \ diff --git a/linux/osd.h b/linux/osd.h index c2360f3..169e041 100644 --- a/linux/osd.h +++ b/linux/osd.h @@ -46,11 +46,12 @@ #include #ifndef SYSCONFDIR -#define SYSCONFDIR "/etc/rdma" +#define SYSCONFDIR "/etc" #endif #ifndef BINDIR #define BINDIR "/usr/bin" #endif +#define ACM_CONF_DIR SYSCONFDIR "/rdma" #define ACM_ADDR_FILE "ibacm_addr.cfg" #define ACM_OPTS_FILE "ibacm_opts.cfg" diff --git a/src/acm.c b/src/acm.c index 82436e6..4e90e8c 100644 --- a/src/acm.c +++ b/src/acm.c @@ -206,8 +206,8 @@ static atomic_t counter[ACM_MAX_COUNTER]; * Service options - may be set through acm_opts file. */ static char *acme = BINDIR "/ib_acme -A"; -static char *opts_file = SYSCONFDIR "/" ACM_OPTS_FILE; -static char *addr_file = SYSCONFDIR "/" ACM_ADDR_FILE; +static char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE; +static char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE; static char log_file[128] = "/var/log/ibacm.log"; static int log_level = 0; static char lock_file[128] = "/var/run/ibacm.pid"; @@ -3157,9 +3157,9 @@ static void show_usage(char *program) printf(" [-D] - run as a daemon (default)\n"); printf(" [-P] - run as a standard process\n"); printf(" [-A addr_file] - address configuration file\n"); - printf(" (default %s/%s\n", SYSCONFDIR, ACM_ADDR_FILE); + printf(" (default %s/%s\n", ACM_CONF_DIR, ACM_ADDR_FILE); printf(" [-O option_file] - option configuration file\n"); - printf(" (default %s/%s\n", SYSCONFDIR, ACM_OPTS_FILE); + printf(" (default %s/%s\n", ACM_CONF_DIR, ACM_OPTS_FILE); } int CDECL_FUNC main(int argc, char **argv) diff --git a/src/acme.c b/src/acme.c index 94ff710..5bc6461 100644 --- a/src/acme.c +++ b/src/acme.c @@ -43,7 +43,7 @@ #include #include "libacm.h" -static char *dest_dir = SYSCONFDIR; +static char *dest_dir = ACM_CONF_DIR; static char *addr_file = ACM_ADDR_FILE; static char *opts_file = ACM_OPTS_FILE; @@ -85,7 +85,7 @@ static void show_usage(char *program) printf(" -O [opt_file] - generate local ibacm_opts.cfg options file\n"); printf(" (default is %s)\n", ACM_OPTS_FILE); printf(" -D dest_dir - specify destination directory for output files\n"); - printf(" (default is %s)\n", SYSCONFDIR); + printf(" (default is %s)\n", ACM_CONF_DIR); printf(" -V - enable verbose output\n"); } -- 2.46.0