提交 deef140b 编写于 作者: L LiuHao 提交者: haozi007

lcr: support syslog for console log

Signed-off-by: NLiuHao <liuhao27@huawei.com>
上级 25d08580
%global _version 2.0.0
%global _release 20200318.003237.gitcdd4f8ab
%global _release 20200402.161208.git1eb4b458
Name: lcr
Version: %{_version}
Release: %{_release}
......
......@@ -182,6 +182,28 @@ static int check_cgroup_dir(const char *value)
return 0;
}
static int check_empty_value(const char *value)
{
if (value == NULL || strlen(value) == 0) {
return -1;
}
return 0;
}
static int check_console_log_driver(const char *value)
{
if (value == NULL || strlen(value) == 0) {
return -1;
}
if (strcmp(value, "syslog") == 0) {
return 0;
}
if (strcmp(value, "json-file") == 0) {
return 0;
}
return -1;
}
static const lcr_annotation_item_t g_require_annotations[] = {
{
"files.limit",
......@@ -203,6 +225,21 @@ static const lcr_annotation_item_t g_require_annotations[] = {
"lxc.console.rotate",
check_console_log_filerotate,
},
{
"log.console.driver",
"lxc.console.logdriver",
check_console_log_driver,
},
{
"log.console.tag",
"lxc.console.syslog_tag",
check_empty_value,
},
{
"log.console.facility",
"lxc.console.syslog_facility",
check_empty_value,
},
{
"rootfs.mount",
"lxc.rootfs.mount",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册