![有没有办法让 samba(smb,nmb)不将启动/停止事件记录为错误?](https://linux22.com/image/764892/%E6%9C%89%E6%B2%A1%E6%9C%89%E5%8A%9E%E6%B3%95%E8%AE%A9%20samba%EF%BC%88smb%EF%BC%8Cnmb%EF%BC%89%E4%B8%8D%E5%B0%86%E5%90%AF%E5%8A%A8%2F%E5%81%9C%E6%AD%A2%E4%BA%8B%E4%BB%B6%E8%AE%B0%E5%BD%95%E4%B8%BA%E9%94%99%E8%AF%AF%EF%BC%9F.png)
smbd
并且nmbd
服务将很多东西记录为错误,当我用 过滤时,这会使我的 journald 日志变得混乱journalctl -p 3
。有没有办法告诉 samba 不要将start/stop/daemon_ready
消息记录为错误(日志级别 3)而是记录为正常消息(日志级别 5/6/7)?
例如:
[2021/03/21 22:43:35.215757, 0] ../../lib/util/become_daemon.c:135(daemon_ready)
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
[2021/03/21 22:43:35.261318, 0] ../../lib/util/become_daemon.c:135(daemon_ready)
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
[2021/03/21 22:43:47.678429, 0] ../../source3/nmbd/nmbd.c:60(terminate)
Got SIGTERM: going down...
[2021/03/21 22:43:47.707379, 0] ../../lib/util/become_daemon.c:135(daemon_ready)
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
[2021/03/21 22:43:47.751871, 0] ../../lib/util/become_daemon.c:135(daemon_ready)
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
[2021/03/21 22:44:10.782143, 0] ../../source3/nmbd/nmbd_become_lmb.c:398(become_local_master_stage2)
*****
Samba name server IVAILOPC-LIN is now a local master browser for workgroup WORKGROUP on subnet 192.168.0.101
*****
这些显然不是错误,只是在我尝试寻找错误时弄乱了我的日志。
这是我的配置的相关部分
log file = /var/log/samba/log.%m
答案1
您可以将其添加到您的smb.conf
syslog = 0
syslog only = Yes
https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#SYSLOG