Thank you for your replay. In "parameters" option the { "key": "logrotate_stdout_options", "value": "rotate 7\nmissingok\ncompress\ndelaycompress" }, The system call logrotate must set a option "create" or "copytruncate", which mode mesos set ? If choose "copytruncate" mode, it may be lost some log?
-----邮件原件----- 发件人: Shuai Lin [mailto:linshuai2...@gmail.com] 发送时间: 2016年5月5日 19:23 收件人: dev 主题: Re: mesos-logrotate-logger binary package problem? That program is not meant to be executed manually. Instead you should configure the logger in the modules flags of your mesos slave. Here is a snippets of a script I used when testing the logrotate logger, you can adjust for your own use case: MODULES_JSON_FILE=/tmp/modules.json cat >$MODULES_JSON_FILE<<EOF { "libraries": [ { "file": "${MESOS_BUILD_DIR}/src/.libs/liblogrotate_container_logger.so", "modules": [ { "name": "org_apache_mesos_LogrotateContainerLogger", "parameters": [ { "key": "launcher_dir", "value": "${MESOS_BUILD_DIR}/src/" }, { "key": "max_stdout_size", "value": "4096B" }, { "key": "max_stderr_size", "value": "4096B" }, { "key": "logrotate_stdout_options", "value": "rotate 7\nmissingok\ncompress\ndelaycompress" }, { "key": "logrotate_stderr_options", "value": "rotate 7\nmissingok\ncompress\ndelaycompress" } ] } ] } ] } EOF ${MESOS_SLAVE} \ --hostname=localhost \ --ip=127.0.0.1 \ --master=127.0.0.1:5050 \ --resources="cpus:2;mem:10240" \ --log_dir="${WORK_DIR}/slave/logs" \ --work_dir="${WORK_DIR}/slave" \ --launcher_dir="${MESOS_BUILD_DIR}/src/" \ --modules=${MODULES_JSON_FILE} \ --container_logger=org_apache_mesos_LogrotateContainerLogger \ --containerizers=docker,mesos Regards, Shuai On Thu, May 5, 2016 at 4:10 PM, pangbingqiang <pangbingqi...@huawei.com> wrote: > Hi all: > > When I alone use “mesos-logrotate-logger” binary package, it will > always error, the log as: > > “Failed to put child in a new session: Operation not permitted”. > > I find it don’t’t call in mesos, so how to use if for log rotate? > > > > [image: cid:image001.png@01D0E8C5.8D08F440] > > > > Bingqiang Pang 00278970 > > > > Distributed and Parallel Software Lab > > Huawei Technologies Co., Ltd. > > Email:pangbingqi...@huawei.com <sut...@huawei.com> > > > > >