> On Nov. 15, 2016, 6:42 a.m., Sivaram Kannan wrote: > > src/slave/containerizer/mesos/containerizer.cpp, line 1388 > > <https://reviews.apache.org/r/53473/diff/6/?file=1563497#file1563497line1388> > > > > Passing None() has the agent crashing when we have switch_user=false. > > Sivaram Kannan wrote: > That is the reason I thought I would have the current user of the agent > set to logger.
The reason the agent/test would fail is because of this line in your fourth diff: https://reviews.apache.org/r/53473/diff/4#7 `container->config.user()` has a return type of `string`. When the value is not set, calling `container->config.user()` returns the empty string. You need to manually convert it to an `Option<string>`. `container->config` is a protobuf defined here: https://github.com/apache/mesos/blob/1.1.x/include/mesos/slave/containerizer.proto#L112 - Joseph ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/53473/#review155916 ----------------------------------------------------------- On Nov. 14, 2016, 1:52 p.m., Sivaram Kannan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/53473/ > ----------------------------------------------------------- > > (Updated Nov. 14, 2016, 1:52 p.m.) > > > Review request for mesos and Joseph Wu. > > > Bugs: MESOS-5856 > https://issues.apache.org/jira/browse/MESOS-5856 > > > Repository: mesos > > > Description > ------- > > Add new param user to logrotate's prepare function. > > > Diffs > ----- > > include/mesos/slave/container_logger.hpp > 939974736f9eb744c83036e074718d2a1eba8b0a > src/slave/container_loggers/lib_logrotate.hpp > 28fdf3bdcc66d473521b377f66ab0b48f6900f58 > src/slave/container_loggers/lib_logrotate.cpp > 53698d339f0f4d2dc916b53239ca0c36bbebcd42 > src/slave/container_loggers/logrotate.hpp > d1db69236f5a9b1dbb3113ad02218a512afdb46b > src/slave/container_loggers/sandbox.hpp > e0aeb32a9ec83af049af8a10010b819c1d8b25d8 > src/slave/container_loggers/sandbox.cpp > cc263ebef7e0c3e778fabafa49faa6dd315adc45 > src/slave/containerizer/docker.cpp c2ed5240aab9ea9d1a386c44c94e5ae7e98d313c > src/slave/containerizer/mesos/containerizer.cpp > ec4ae32485a7ab6c9f73c512004d1220482a188e > src/tests/container_logger_tests.cpp > 1bb94a8461e481983f25a44737e4011ed5fc4b1f > > Diff: https://reviews.apache.org/r/53473/diff/ > > > Testing > ------- > > Run the mesos-logrotate-logger with un-priviledged user and verify whether > the logs are getting rotated. > Run the mesos-logrotate-logger as root user and verify whether the logs are > getting rotated. > > > Thanks, > > Sivaram Kannan > >
