openvswitch console输出
对ovs的日志输出系统很好奇,为什么ovs的log不能直接在控制台输出。
ovs-vswitchd的常用启动选项
–detach
Runs ovs-vswitchd as a background process. The process forks, and in the child it starts a new session, closes the standard file descriptors (which has the side effect of disabling logging to the console), and changes its current directory to the root (unless --no-chdir is specified). After the child completes its initialization, the parent exits. ovs-vswitchd detaches only after it has connected to the database, retrieved the initial configuration, and set up that configuration.
我们在启动ovs时,vswitchd的常用选项就是 --detach,官方文档可以看到,作为守护进程,vswitchd调用close_standard_fds()关闭了standard fd,从而禁止日志在控制台的打印。代码如下:
/* openvswitch-2.5.0\lib\daemon.c +103 */
/* Close standard file descriptors (except any that the client has requested we* leave open by calling daemon_save_fd()). If we're started from e.g. an SSH* session, then this keeps us from holding that session open artificially. */
void
close_standard_fds(void)
{int null_fd = get_null_fd();if (null_fd >= 0) {int fd;for (fd = 0; fd < 3; fd++) {if (!save_fds[fd]) {dup2(null_fd, fd);}}}/* Disable logging to stderr to avoid wasting CPU time. */vlog_set_levels(NULL, VLF_CONSOLE, VLL_OFF);
}
当vswitchd启动没有detach参数时,日志会分别输出到控制台和/var/log/openvswitch/的日志文件中。
root@nettraffic-vm:~/openvswitch/openvswitch-2.5.0# ovs-vswitchd --pidfile
2021-04-12T16:27:24Z|00001|ovs_numa|INFO|Discovered 2 CPU cores on NUMA node 0
2021-04-12T16:27:24Z|00002|ovs_numa|INFO|Discovered 1 NUMA nodes and 2 CPU cores
2021-04-12T16:27:24Z|00003|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting…
2021-04-12T16:27:24Z|00004|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected
2021-04-12T16:27:24Z|00005|ofproto_dpif|INFO|system@ovs-system: Datapath supports recirculation
2021-04-12T16:27:24Z|00006|ofproto_dpif|INFO|system@ovs-system: MPLS label stack length probed as 1
2021-04-12T16:27:24Z|00007|ofproto_dpif|INFO|system@ovs-system: Datapath supports unique flow ids
2021-04-12T16:27:24Z|00008|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_state
2021-04-12T16:27:24Z|00009|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_zone
2021-04-12T16:27:24Z|00010|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_mark
2021-04-12T16:27:24Z|00011|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_label
2021-04-12T16:27:24Z|00012|bridge|INFO|bridge s1: added interface s1-eth2 on port 2
2021-04-12T16:27:24Z|00001|ofproto_dpif_upcall(handler1)|INFO|received packet on unassociated datapath port 0
2021-04-12T16:27:24Z|00013|bridge|INFO|bridge s1: added interface s1-eth1 on port 1
2021-04-12T16:27:24Z|00014|bridge|WARN|could not open network device vxlan1 (No such device)
2021-04-12T16:27:24Z|00015|bridge|INFO|bridge s1: added interface s1 on port 65534
2021-04-12T16:27:24Z|00016|bridge|WARN|could not open network device vxlan (No such device)
2021-04-12T16:27:24Z|00017|bridge|INFO|bridge s1: using datapath ID 0000000000000001
2021-04-12T16:27:24Z|00018|connmgr|INFO|s1: added service controller “punix:/var/run/openvswitch/s1.mgmt”
2021-04-12T16:27:24Z|00019|connmgr|INFO|s1: added service controller “ptcp:6654”
2021-04-12T16:27:24Z|00020|bridge|WARN|could not open network device vxlan1 (No such device)
2021-04-12T16:27:24Z|00021|bridge|WARN|could not open network device vxlan (No such device)
2021-04-12T16:27:24Z|00022|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.5.0
openvswitch console输出相关推荐
- qt获取console输出_怎么在Centos 7 安装 Qt-4.8.6-MySQL 驱动?
Qt 是 C++ 的一个常用 gui 大而全的框架, 包含了很多实用的内容, 包括了数据库连接, 使开发变得非常的简单. MySQL 在 V5 已经是开箱即用了, MySQL-client 驱动默认安 ...
- Eclipse修改console输出最大行数及(IOConsole Updater)
使用Eclipse进行调试时,希望终端输出窗口的缓存尽可能大一些,可以进行如下配置: Windows->Preferences->Run/Debug->Console 但是如果将co ...
- 网页“console”输出图文信息
http://www.monmonkey.com/javascript/jiben2.html 参考以上链接中的转义字符使用. http://www.cnblogs.com/Wayou/p/chrom ...
- java console输出_将java console的输出写入文件
FileOutputStream bos = new FileOutputStream("output.txt"); System.setOut(new PrintStream(b ...
- python3 windows console 输出乱码问题
python3 windows console 输出乱码问题 问题 在python里面print韩文时,控制台报如下错误: UnicodeEncodeError: 'gbk' codec can't ...
- 图解C# Console 输出和Console相关编程复习总结
1 基本控制台输出 首先进入 SharpDevelop ,新建一个控制台工程: SharpDevelop简介: http://blog.csdn.net/bcbobo21cn/article/deta ...
- Tomcat下项目调整Log4J的console输出级别,减少输出信息
场景 输出优先级,由低到高 DEBUG,INFO,WARN,ERROR,FATAL 输出方式说明 org.apache.log4j.ConsoleAppender(控制台), org.apache ...
- js console 输出到文件_Node.js核心入门
正文 核心模块是Node.js的心脏,主要是有一些精简高效的库组成(这方面和Python有很大的相似之处),为Node.js提供了基础的API.主要内容包括: Node.js核心入门(一) 全局对象 ...
- 搞懂事件循环,面试不再害怕console输出问题。(自整)
事件循环 浏览器的进程模型 进程和线程 进程可以认为是浏览器运行占用的内存空间,线程则为每个内存空间中处理的多个任务之一 每个进程中都会默认开启一个主线程以及多个其他线程来处理不同的任务,且各个进程之 ...
- 微软雅黑console_【工作日记03】使用console输出网站logo彩蛋
工作日记是笔者记录在日常工作中对负责的前端项目和任务的总结和提炼,在工作中寻乐趣,在代码中找灵魂,输出工作中有价值有意思的沉淀,分享知识,娱乐自己.wx:wxid_wdjyyo939vja22 相信大 ...
最新文章
- 随机变量,概率密度及其统计量
- 【NLP】文本分类综述 (上)
- 复合类型_没有学不会的python--复合类型(1)--概念和元组
- 最接近的三数之和Python解法
- 利用Skywalking-netcore监控你的应用性能
- java streams_使用Stream.peek在Java Streams内部进行窥视
- [react] contextType是什么?它有什么用?
- AOP的实现方式比较,cglib vs jdk
- Nginx加密与上游服务器的TCP网络通信
- Mysql中各种常见数据库存储引擎对比
- 对Unity3d C#手动处理异常产生
- SpringBoot是什么?
- object-c中NSString与int和float的相互转换
- Android系统信息获取 之一:系统存储信息的获取(RAM,ROM,SDCard)
- Sicily 1049. Mondriaan 解题报告
- Dapr for dotnet | 服务调用-Service invoke(HTTP协议)
- 李大仁是真的爱程又青
- table thead tr设置表头背景色未完全覆盖的问题
- linux打不开vlc怎么办下面是解决方法
- 【微信朋友圈,如何测】