You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2016/01/27 01:09:52 UTC

mesos git commit: Fixed logrotate ContainerLogger on Centos6.

Repository: mesos
Updated Branches:
  refs/heads/master c58b1377b -> 56b3e6cca


Fixed logrotate ContainerLogger on Centos6.

The `logrotate --version` flag is actually a very recent addition (3.9.1).

The `--help` flag is more likely to be present on a supported
system-with-logrotate, given logrotate's usage of popopt.

Review: https://reviews.apache.org/r/42820/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/56b3e6cc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/56b3e6cc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/56b3e6cc

Branch: refs/heads/master
Commit: 56b3e6cca0257bf153862402e9414f5340ae82b5
Parents: c58b137
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Tue Jan 26 16:00:56 2016 -0800
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Tue Jan 26 16:09:48 2016 -0800

----------------------------------------------------------------------
 src/slave/container_loggers/lib_logrotate.hpp | 9 +++++----
 src/slave/container_loggers/logrotate.hpp     | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/56b3e6cc/src/slave/container_loggers/lib_logrotate.hpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/lib_logrotate.hpp b/src/slave/container_loggers/lib_logrotate.hpp
index 5f79fd8..8c5602d 100644
--- a/src/slave/container_loggers/lib_logrotate.hpp
+++ b/src/slave/container_loggers/lib_logrotate.hpp
@@ -101,13 +101,14 @@ struct Flags : public virtual flags::FlagsBase
         "'logrotate' instead of the system's 'logrotate'.",
         "logrotate",
         [](const std::string& value) -> Option<Error> {
-          // Check if `logrotate` exists via the version command.
+          // Check if `logrotate` exists via the help command.
           // TODO(josephw): Consider a more comprehensive check.
-          Try<std::string> versionCommand = os::shell(value + " --version");
+          Try<std::string> helpCommand =
+            os::shell(value + " --help > /dev/null");
 
-          if (versionCommand.isError()) {
+          if (helpCommand.isError()) {
             return Error(
-                "Failed to check logrotate version: " + versionCommand.error());
+                "Failed to check logrotate: " + helpCommand.error());
           }
 
           return None();

http://git-wip-us.apache.org/repos/asf/mesos/blob/56b3e6cc/src/slave/container_loggers/logrotate.hpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/logrotate.hpp b/src/slave/container_loggers/logrotate.hpp
index fd9c071..16d9232 100644
--- a/src/slave/container_loggers/logrotate.hpp
+++ b/src/slave/container_loggers/logrotate.hpp
@@ -98,13 +98,14 @@ struct Flags : public virtual flags::FlagsBase
         "'logrotate' instead of the system's 'logrotate'.",
         "logrotate",
         [](const std::string& value) -> Option<Error> {
-          // Check if `logrotate` exists via the version command.
+          // Check if `logrotate` exists via the help command.
           // TODO(josephw): Consider a more comprehensive check.
-          Try<std::string> versionCommand = os::shell(value + " --version");
+          Try<std::string> helpCommand =
+            os::shell(value + " --help > /dev/null");
 
-          if (versionCommand.isError()) {
+          if (helpCommand.isError()) {
             return Error(
-                "Failed to check logrotate version: " + versionCommand.error());
+                "Failed to check logrotate: " + helpCommand.error());
           }
 
           return None();