Updated Branches: refs/heads/3.4.x eeb41df01 -> 151326711
TS-2127 Move hostdb.config to var/trafficserver This eliminates the entire etc/internal directory, and moves the hostdb.config to the var/trafficserver (depending on configure option of course). This means hostdb.config and host.db are now in the same directory, together with all other "state" files: -rw-r--r-- 1 nobody nobody 71 Aug 16 09:51 hostdb.config -rw-r--r-- 1 nobody nobody 268435456 Aug 16 09:52 cache.db -rw-r--r-- 1 root root 6 Aug 16 10:47 cop.lock -rw-r--r-- 1 nobody nobody 6 Aug 16 10:47 manager.lock srwxr-xr-x 1 nobody nobody 0 Aug 16 10:47 process_server srwxr-xr-x 1 nobody nobody 0 Aug 16 10:47 mgmtapisocket srwxr-xr-x 1 nobody nobody 0 Aug 16 10:47 eventapisocket -rw-r--r-- 1 nobody nobody 6 Aug 16 10:47 server.lock -rw-r--r-- 1 nobody nobody 1068 Aug 16 10:50 stats.snap -rw-r--r-- 1 nobody nobody 25935872 Aug 16 10:50 host.db -rw------- 1 nobody nobody 64208 Aug 16 10:50 records.snap Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/15132671 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/15132671 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/15132671 Branch: refs/heads/3.4.x Commit: 1513267119e792123a37b00d6edd93eb47f0979b Parents: eeb41df Author: Leif Hedstrom <[email protected]> Authored: Sat Aug 10 14:35:14 2013 -0600 Committer: Leif Hedstrom <[email protected]> Committed: Fri Aug 16 10:54:37 2013 -0600 ---------------------------------------------------------------------- CHANGES | 5 +++++ cop/TrafficCop.cc | 2 +- doc/admin/faqs.en.rst | 4 ++-- iocore/hostdb/HostDB.cc | 2 +- iocore/hostdb/MultiCache.cc | 8 ++------ proxy/Main.cc | 3 +-- proxy/Makefile.am | 5 ++--- 7 files changed, 14 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15132671/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 46f1603..3ad4edc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- + Changes with Apache Traffic Server 3.4.0 + + *) [TS-2127] Move hostdb.config to var/trafficserver, together with with the + host.db itself. + *) [TS-2132, TS-2131] ${libexecdir} and $(localstatedir} chowned needlessly chowned to to ATS' user. Author: Tomasz Kuzemko <[email protected]> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15132671/cop/TrafficCop.cc ---------------------------------------------------------------------- diff --git a/cop/TrafficCop.cc b/cop/TrafficCop.cc index 8cf97ee..0b03c31 100644 --- a/cop/TrafficCop.cc +++ b/cop/TrafficCop.cc @@ -1521,7 +1521,7 @@ check_no_run() int err; cop_log_trace("Entering check_no_run()\n"); - snprintf(path, sizeof(path), "%s/internal/no_cop", config_dir); + snprintf(path, sizeof(path), "%s/no_cop", runtime_dir); do { err = stat(path, &info); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15132671/doc/admin/faqs.en.rst ---------------------------------------------------------------------- diff --git a/doc/admin/faqs.en.rst b/doc/admin/faqs.en.rst index e3e9bbd..28ab7fa 100644 --- a/doc/admin/faqs.en.rst +++ b/doc/admin/faqs.en.rst @@ -296,9 +296,9 @@ client machines have no access to the cluster ports. The following message appears repeatedly in the system log file: :: - traffic_cop[16056]: encountered "config/internal/no_cop" file...exiting + traffic_cop[16056]: encountered "var/trafficserver/no_cop" file...exiting -The file ``config/internal/no_cop`` acts as an administrative control +The file ``var/trafficserver/no_cop`` acts as an administrative control that instructs the ``traffic_cop`` process to exit immediately without starting ``traffic_manager`` or performing any health checks. The ``no_cop`` file prevents Traffic Server from starting automatically when http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15132671/iocore/hostdb/HostDB.cc ---------------------------------------------------------------------- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index f7cd00a..0b114b4 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -414,7 +414,7 @@ HostDBCache::start(int flags) Note("reconfiguring host database"); char p[PATH_NAME_MAX + 1]; - Layout::relative_to(p, PATH_NAME_MAX, system_config_directory, "internal/hostdb.config"); + Layout::relative_to(p, PATH_NAME_MAX, system_runtime_dir, "hostdb.config"); if (unlink(p) < 0) Debug("hostdb", "unable to unlink %s", p); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15132671/iocore/hostdb/MultiCache.cc ---------------------------------------------------------------------- diff --git a/iocore/hostdb/MultiCache.cc b/iocore/hostdb/MultiCache.cc index ebdea6c..a9a6ceb 100644 --- a/iocore/hostdb/MultiCache.cc +++ b/iocore/hostdb/MultiCache.cc @@ -501,10 +501,8 @@ MultiCacheBase::read_config(const char *config_filename, Store & s, char *fn, in { int scratch; char p[PATH_NAME_MAX + 1], buf[256]; - char i[PATH_NAME_MAX + 1]; - ink_filepath_make(i, sizeof(i), system_config_directory, "internal/"); - Layout::relative_to(p, sizeof(p), i, config_filename); + Layout::relative_to(p, sizeof(p), system_runtime_dir, config_filename); int fd =::open(p, O_RDONLY); if (fd < 0) @@ -539,11 +537,9 @@ int MultiCacheBase::write_config(const char *config_filename, int nominal_size, int abuckets) { char p[PATH_NAME_MAX + 1], buf[256]; - char i[PATH_NAME_MAX + 1]; int fd, retcode = -1; - ink_filepath_make(i, sizeof(i), system_config_directory, "internal/"); - Layout::relative_to(p, sizeof(p), i, config_filename); + Layout::relative_to(p, sizeof(p), system_runtime_dir, config_filename); // XXX: Shouldn't that be 0664? // http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15132671/proxy/Main.cc ---------------------------------------------------------------------- diff --git a/proxy/Main.cc b/proxy/Main.cc index a13633f..be52f0a 100644 --- a/proxy/Main.cc +++ b/proxy/Main.cc @@ -584,8 +584,7 @@ cmd_clear(char *cmd) char p[PATH_NAME_MAX]; if (c_all || c_hdb) { Note("Clearing Configuration"); - Layout::relative_to(p, sizeof(p), system_config_directory, - "internal/hostdb.config"); + Layout::relative_to(p, sizeof(p), system_runtime_dir, "hostdb.config"); if (unlink(p) < 0) Note("unable to unlink %s", p); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15132671/proxy/Makefile.am ---------------------------------------------------------------------- diff --git a/proxy/Makefile.am b/proxy/Makefile.am index 7e25e34..d26227e 100644 --- a/proxy/Makefile.am +++ b/proxy/Makefile.am @@ -293,13 +293,12 @@ versiondir = $(pkgsysconfdir) install-data-local: if [ `id -un` != "root" ]; then \ $(INSTALL) -d $(DESTDIR)$(pkglocalstatedir) $(DESTDIR)$(pkglogdir) $(DESTDIR)$(pkgruntimedir) \ - $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkgsysconfdir)/internal $(DESTDIR)$(pkgdatadir) \ - $(DESTDIR)$(pkgcachedir); \ + $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgcachedir); \ else \ $(INSTALL) -d $(DESTDIR)$(pkglocalstatedir); \ $(INSTALL) -d -o $(pkgsysuser) -g $(pkgsysgroup) $(DESTDIR)$(pkglogdir) \ $(DESTDIR)$(pkgruntimedir) $(DESTDIR)$(pkgsysconfdir) \ - $(DESTDIR)$(pkgsysconfdir)/internal $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgcachedir); \ + $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgcachedir); \ fi install-data-hook:
