--- vnstat-2.8.old/src/cfg.c +++ vnstat-2.8/src/cfg.c @@ -443,7 +443,9 @@ } cfg.cfgfile[0] = '\0'; - /* possible config files: 1) --config 2) $HOME/.vnstatrc 3) /etc/vnstat.conf 4) none */ + /* possible config files: 1) --config 2) $HOME/.vnstatrc + 3) __META_PREFIX__/etc/vnstat.conf + 4) none */ if (cfgfile[0] != '\0') { @@ -471,7 +473,12 @@ /* try to open first available config file */ if (tryhome && (*fd = fopen(buffer, "r")) != NULL) { strncpy_nt(cfg.cfgfile, buffer, 512); - } else if ((*fd = fopen("/etc/vnstat.conf", "r")) != NULL) { + } + else if ((*fd = fopen ("__META_PREFIX__/etc/vnstat.conf", "r")) != NULL) + { + snprintf (cfg.cfgfile, 512, "__META_PREFIX__/etc/vnstat.conf"); + } + else if ((*fd = fopen("/etc/vnstat.conf", "r")) != NULL) { snprintf(cfg.cfgfile, 512, "/etc/vnstat.conf"); } else if ((*fd = fopen("/usr/local/etc/vnstat.conf", "r")) != NULL) { snprintf(cfg.cfgfile, 512, "/usr/local/etc/vnstat.conf");