SAMBA & SMB Services Problem Starting

When I type:

sudo systemctl status samba.service

    ~  sudo systemctl status samba.service                                                                                          ✔ 
[sudo] password for m6bmgdipolog: 
× samba.service - Samba AD Daemon
     Loaded: loaded (/usr/lib/systemd/system/samba.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2022-07-28 00:18:43 EDT; 28s ago
       Docs: man:samba(8)
             man:samba(7)
             man:smb.conf(5)
    Process: 933 ExecStart=/usr/bin/samba --foreground --no-process-group $SAMBAOPTIONS (code=exited, status=1/FAILURE)
   Main PID: 933 (code=exited, status=1/FAILURE)
     Status: "daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details"
      Error: 22 (Invalid argument)
        CPU: 73ms

Jul 28 00:18:43 M6-BMGDIPOLOG samba[933]:   daemon_status: daemon 'samba' : Starting process...
Jul 28 00:18:43 M6-BMGDIPOLOG samba[933]: [2022/07/28 00:18:43.457187,  0] ../../source4/samba/server.c:851(binary_smbd_main)
Jul 28 00:18:43 M6-BMGDIPOLOG samba[933]:   At this time the 'samba' binary should only be used for either:
Jul 28 00:18:43 M6-BMGDIPOLOG samba[933]:   'server role = active directory domain controller' or to access the ntvfs file server with 'ser>
Jul 28 00:18:43 M6-BMGDIPOLOG samba[933]:   You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
Jul 28 00:18:43 M6-BMGDIPOLOG samba[933]: [2022/07/28 00:18:43.457290,  0] ../../lib/util/become_daemon.c:119(exit_daemon)
Jul 28 00:18:43 M6-BMGDIPOLOG samba[933]:   exit_daemon: daemon failed to start: Samba detected misconfigured 'server role' and exited. Che>
Jul 28 00:18:43 M6-BMGDIPOLOG systemd[1]: samba.service: Main process exited, code=exited, status=1/FAILURE
Jul 28 00:18:43 M6-BMGDIPOLOG systemd[1]: samba.service: Failed with result 'exit-code'.
Jul 28 00:18:43 M6-BMGDIPOLOG systemd[1]: Failed to start Samba AD Daemon.

When I type:

sudo systemctl status smb.service

    ~  sudo systemctl status smb.service                                                                                  3 ✘  16s  
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Thu 2022-07-28 00:18:43 EDT; 48s ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 948 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 3 (limit: 4502)
     Memory: 9.9M
        CPU: 56ms
     CGroup: /system.slice/smb.service
             ├─948 /usr/bin/smbd --foreground --no-process-group
             ├─958 /usr/bin/smbd --foreground --no-process-group
             └─959 /usr/bin/smbd --foreground --no-process-group

Jul 28 00:18:43 M6-BMGDIPOLOG systemd[1]: Starting Samba SMB Daemon...
Jul 28 00:18:43 M6-BMGDIPOLOG smbd[948]: [2022/07/28 00:18:43.465018,  0] ../../source3/smbd/server.c:1741(main)
Jul 28 00:18:43 M6-BMGDIPOLOG smbd[948]:   smbd version 4.16.3 started.
Jul 28 00:18:43 M6-BMGDIPOLOG smbd[948]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Jul 28 00:18:43 M6-BMGDIPOLOG systemd[1]: Started Samba SMB Daemon.

When I type:

testparm

    ~  testparm                                                                                                                                                                   INT ✘ 
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
	client min protocol = SMB2
	disable spoolss = Yes
	dns proxy = No
	load printers = No
	log file = /var/log/samba/%m.log
	map to guest = Bad Password
	max log size = 1000
	name resolve order = lmhosts bcast host wins
	obey pam restrictions = Yes
	pam password change = Yes
	passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
	passwd program = /usr/bin/passwd %u
	printcap name = /dev/null
	security = USER
	server role = standalone server
	show add printer wizard = No
	unix password sync = Yes
	usershare allow guests = Yes
	usershare max shares = 100
	usershare path = /var/lib/samba/usershare
	idmap config * : backend = tdb
	force create mode = 0070
	force directory mode = 0070
	printing = bsd


[homes]
	browseable = No
	comment = Home Directories
	create mask = 0700
	directory mask = 0700
	valid users = %S


[printers]
	browseable = No
	comment = All Printers
	create mask = 0700
	path = /var/spool/samba
	printable = Yes


[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers

Read the error message - then search the samba documentation

Some basic troubleshooting is available

Do not enable and start the samba.service. Do it only if you want to run a Active Directory domain controller.
See the Arch wiki on Sambas AD to figure out if you really want this.

https://wiki.archlinux.org/title/Samba/Active_Directory_domain_controller

before it wasn’t like this, I can immediately access to Windows Shared Folder from my Windows 11 laptop, but after I updated it to 4.16 can’t access no more. It will always says “Failed to mount windows share: Invalid argument”

That may be true - but your issue is very unclear and your comments confusing.

If your Windows 11 cannot connect and the above is a reference to your Windows 11 system - let it be clear - this is not a Manjaro issue.

The error message is quite clear - you have a configuration problem - which is why the service refuses to start.

Have you checked your logs?

Upstream Samba is constantly evolving and has to adapt to avoid ransomware propagating over network.

If you are using Manjaro as a stand-alone fileserver in your home network - I strongly advise you to go over your configuration - simplify it as much as possible.

The guide referenced earlier provides a working configuration

I downgraded the SAMBA & SMB to 4.15 and this is what happened when i run both samba ang smb services

    ~  sudo systemctl status samba.service                                                                                          ✔ 
[sudo] password for m6bmgdipolog: 
× samba.service - Samba AD Daemon
     Loaded: loaded (/usr/lib/systemd/system/samba.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2022-07-28 19:34:01 EDT; 5s ago
       Docs: man:samba(8)
             man:samba(7)
             man:smb.conf(5)
    Process: 1379 ExecStart=/usr/bin/samba --foreground --no-process-group $SAMBAOPTIONS (code=exited, status=127)
   Main PID: 1379 (code=exited, status=127)
        CPU: 4ms

Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: Starting Samba AD Daemon...
Jul 28 19:34:01 M6-BMGDIPOLOG samba[1379]: /usr/bin/samba: error while loading shared libraries: libicui18n.so.70: cannot open shared objec>
Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: samba.service: Main process exited, code=exited, status=127/n/a
Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: samba.service: Failed with result 'exit-code'.
Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: Failed to start Samba AD Daemon.

    ~  sudo systemctl status smb.service                                                                                                                                    3 ✘  11s  
× smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2022-07-28 19:34:01 EDT; 23s ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
    Process: 1380 ExecStart=/usr/bin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=127)
   Main PID: 1380 (code=exited, status=127)
        CPU: 6ms

Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: Starting Samba SMB Daemon...
Jul 28 19:34:01 M6-BMGDIPOLOG smbd[1380]: /usr/bin/smbd: error while loading shared libraries: libicui18n.so.70: cannot open shared object file: No such file or directory
Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: smb.service: Main process exited, code=exited, status=127/n/a
Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: smb.service: Failed with result 'exit-code'.
Jul 28 19:34:01 M6-BMGDIPOLOG systemd[1]: Failed to start Samba SMB Daemon.
    ~ 

Downgrading packages are not supported. That can and will cause problems like…

If you want help from our volunteer community members, please follow the advice provided and follow the helpful tutorials linked above.

1 Like

This is correct:

server role = standalone
1 Like
   ~  cat /etc/samba/smb.conf                                                                                                                                              3 ✘  11s  

[global]
   workgroup = WORKGROUP
   dns proxy = no
   log file = /var/log/samba/%m.log
   max log size = 1000
   client min protocol = SMB2
   server role = standalone
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
   pam password change = yes
   map to guest = Bad Password
   usershare allow guests = yes
   name resolve order = lmhosts bcast host wins
   security = user
   guest account = nobody
   usershare path = /var/lib/samba/usershare
   usershare max shares = 100
   usershare owner only = yes
   force create mode = 0070
   force directory mode = 0070
   load printers = no
   printing = bsd
   printcap name = /dev/null
   disable spoolss = yes
   show add printer wizard = no

[homes]
   comment = Home Directories
   browseable = no
   read only = yes
   create mask = 0700
   directory mask = 0700
   valid users = %S

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
    ~ 