有没有办法让 samba(smb,nmb)不将启动/停止事件记录为错误?

有没有办法让 samba(smb,nmb)不将启动/停止事件记录为错误?

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

相关内容