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 <[email protected]>
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:[email protected]]
>
>
>
> Bingqiang Pang 00278970
>
>
>
> Distributed and Parallel Software Lab
>
> Huawei Technologies Co., Ltd.
>
> Email:[email protected] <[email protected]>
>
>
>
>
>