Unable to start SAMBA

Hello, I am new to fedora and I am unable to start samba.

sudo systemctl start smb.service gives
Job for smb.service failed because the control process exited with error code.
See “systemctl status smb.service” and “journalctl -xeu smb.service” for details.

systemctl status smb.service
× smb.service - Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2022-08-16 08:14:25 IST; 5min ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Process: 3997 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=1/FAILURE)
Main PID: 3997 (code=exited, status=1/FAILURE)
CPU: 68ms

Aug 16 08:14:25 fedora systemd[1]: Starting smb.service - Samba SMB Daemon…
Aug 16 08:14:25 fedora smbd[3997]: [2022/08/16 08:14:25.183073, 0] …/…/source3/smbd/server.c:1741(main)
Aug 16 08:14:25 fedora smbd[3997]: smbd version 4.16.4 started.
Aug 16 08:14:25 fedora smbd[3997]: Copyright Andrew Tridgell and the Samba Team 1992-2022
Aug 16 08:14:25 fedora systemd[1]: smb.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 08:14:25 fedora systemd[1]: smb.service: Failed with result ‘exit-code’.
Aug 16 08:14:25 fedora systemd[1]: Failed to start smb.service - Samba SMB Daemon.

journalctl -xeu smb.service
░░
░░ A start job for unit smb.service has begun execution.
░░
░░ The job identifier is 3376.
Aug 16 08:14:25 fedora smbd[3997]: [2022/08/16 08:14:25.183073, 0] …/…/source3/smbd/server.c:1741(main)
Aug 16 08:14:25 fedora smbd[3997]: smbd version 4.16.4 started.
Aug 16 08:14:25 fedora smbd[3997]: Copyright Andrew Tridgell and the Samba Team 1992-2022
Aug 16 08:14:25 fedora systemd[1]: smb.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: systemd-devel Info Page
░░
░░ An ExecStart= process belonging to unit smb.service has exited.
░░
░░ The process’ exit code is ‘exited’ and its exit status is 1.
Aug 16 08:14:25 fedora systemd[1]: smb.service: Failed with result ‘exit-code’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░
░░ The unit smb.service has entered the ‘failed’ state with result ‘exit-code’.
Aug 16 08:14:25 fedora systemd[1]: Failed to start smb.service - Samba SMB Daemon.
░░ Subject: A start job for unit smb.service has failed
░░ Defined-By: systemd
░░
░░ A start job for unit smb.service has finished with a failure.
░░
░░ The job identifier is 3376 and the job result is failed.

sudo testparm -s
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed

Server role: ROLE_STANDALONE

[global]
workgroup = SIMPLE
idmap config * : backend = tdb

[test]
comment = For testing only, please
guest ok = Yes
path = /home
read only = No

Unfortunately, I don’t see anything that tells us why in the logs here. Is there any other info with journalctl -u smb?

2 Likes

Looking at your smb.conf content I do not see a [homes] section and man smb.conf does not show that [test] is an allowed section name.

I just started smb.conf on my system with the default smb.conf file and it started as expected. I then added the [test] section you displayed and restarted smb.service and it again started OK.

Finally I altered the smb.conf file to exactly match the config you posted and again restarted smb and it once again restarted properly.

I did not test connections, but as far as I can tell there is nothing in the config that would cause the failure.

Just as a thought.
Have you done a full update using dnf upgrade --refresh to ensure that everything is fully up to date and synced? If not please do so then retry stopping and starting smb.

Man smbd will give info about how to configure additional logging when starting it as a service by adding log level = number (using an appropriate number) to the global section of smb.conf.

I used the default smb.conf and logging gave me this on startup

[2022/08/16 09:34:58.690242,  0] ../../source3/smbd/server.c:1741(main)
  smbd version 4.16.4 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2022

and adding log level = 2 to the global section gave me this on startup.

[2022/08/16 09:36:38.933566,  0] ../../source3/smbd/server.c:1741(main)
  smbd version 4.16.4 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2022
  added interface wlp4s0 ip=192.168.2.111 bcast=192.168.2.255 netmask=255.255.255.0
  added interface virbr0 ip=192.168.124.1 bcast=192.168.124.255 netmask=255.255.255.0
[2022/08/16 09:57:45.570820,  0] ../../source3/smbd/server.c:1741(main)
  smbd version 4.16.4 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2022
[2022/08/16 09:57:45.570991,  2] ../../source3/smbd/server.c:1744(main)
  uid=0 gid=0 euid=0 egid=0
[2022/08/16 09:57:45.571294,  2] ../../source3/lib/tallocmsg.c:84(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2022/08/16 09:57:45.571306,  2] ../../source3/lib/dmallocmsg.c:78(register_dmalloc_msgs)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2022/08/16 09:57:45.571555,  2] ../../source3/param/loadparm.c:2890(lp_do_section)
  Processing section "[homes]"
[2022/08/16 09:57:45.571613,  2] ../../source3/param/loadparm.c:2890(lp_do_section)
  Processing section "[printers]"
[2022/08/16 09:57:45.571662,  2] ../../source3/param/loadparm.c:2890(lp_do_section)
  Processing section "[print$]"
  added interface wlp4s0 ip=192.168.2.111 bcast=192.168.2.255 netmask=255.255.255.0
  added interface virbr0 ip=192.168.124.1 bcast=192.168.124.255 netmask=255.255.255.0
[2022/08/16 09:57:45.575454,  1] ../../source3/profile/profile.c:53(set_profile_level)
  INFO: Profiling turned OFF from pid 1137116
[2022/08/16 09:57:45.575783,  2] ../../source3/lib/tallocmsg.c:84(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2022/08/16 09:57:45.575833,  2] ../../source3/passdb/pdb_interface.c:163(make_pdb_method_name)
  No builtin backend found, trying to load plugin
[2022/08/16 09:57:45.581701,  2] ../../source3/lib/tallocmsg.c:84(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2022/08/16 09:57:45.582360,  2] ../../source3/lib/tallocmsg.c:84(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2022/08/16 09:57:45.593601,  2] ../../source3/smbd/server.c:1379(smbd_parent_loop)
  waiting for connections

The logs are in /var/log/samba.

2 Likes