3

smbd and nmbd services log a lot of things as errors which clutters my journald logs when I filter it with journalctl -p 3. Is there a way to tell samba to not log start/stop/daemon_ready messages as errors (log level 3) but as normal messages instead (log level 5/6/7)? For example:

[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

  *****

These are obviously not errors and just clutter my log when I try to look for errors.

This is the relevant part of my config


log file = /var/log/samba/log.%m
FieryRider
  • 43
  • 5

1 Answers1

0

You could add this to the [global] section of your smb.conf

  syslog = 0
  syslog only = Yes

https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#SYSLOG

Pourko
  • 101
  • 2
  • 1
    This does not solve my problem. Actually it does nothing. What I wanted is to make the messages like `daemon_ready: daemon 'smbd' finished starting up and ready to serve connections` to appear as normal messages in `journalctl` (with log level 5 or 6 or 7) and not as errors (in red color and with log level 3). I still want then to be logged in `journald`. Also I noticed that the logs disappear from `journald` when I remove `log file` option for some reason. – FieryRider Mar 31 '21 at 18:48
  • @FieryRider Those messages are not coming from the samba daemon (smbd), but from your daemon start scripts. Look into how exactly you're starting `smbd`. What is that `become_daemon` thing you're using? Instead of that, you could just start the samba daemon with a `smbd -D` command. – Pourko Mar 31 '21 at 19:12