The SMB service is unable to start, SAMBA shares can’t be accessed. Using systemctl fails to start the service and below is the status of the smb service.

# systemctl status smb.service
? smb.service - Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2017-07-07 10:07:54 AEST; 3 days ago
Process: 25847 ExecStart=/usr/sbin/smbd $SMBDOPTIONS (code=exited, status=1/FAILURE)
Main PID: 25847 (code=exited, status=1/FAILURE)
The following entries are logged to the /var/log/messages file:  

Jul 07 10:07:54 localhost smbd[25847]: Unable to open new log file '/var/log/sa...ed
Jul 07 10:07:54 localhost smbd[25847]: [2017/07/07 10:07:54, 0] ../lib/util/de...l)
Jul 07 10:07:54 localhost smbd[25847]: Unable to open new log file '/var/log/sa...ed
Jul 07 10:07:54 localhost smbd[25847]: [2017/07/07 10:07:54, 0] ../source3/smb...n)
Jul 07 10:07:54 localhost smbd[25847]: smbd version 4.2.3 started.
Jul 07 10:07:54 localhost smbd[25847]: Copyright Andrew Tridgell and the Samba ...14
Jul 07 10:07:54 localhost systemd[1]: smb.service: main process exited, code=ex...RE
Jul 07 10:07:54 localhost systemd[1]: Failed to start Samba SMB Daemon.
Jul 07 10:07:54 localhost systemd[1]: Unit smb.service entered failed state.
Jul 07 10:07:54 localhost systemd[1]: smb.service failed.

 

The Solution

 

1. Disable SELinux

In most of the cases in RHEL 7, the samba service does not start if the SELinux is enabled (enforced). Disable SELinux or make it only advisory. The setenforce command is used to change between enforcing and permissive mode. To change to permissive mode:

# setenforce 0

 

Use the getenforce command to view current SELinux mode:

# getenforce
Permissive

 

2. Configure SELinux to allow SAMBA services

In case if you do not want to disable SELinux, you can review the SELinux policy allowing the SAMBA subsystem to run. To check the current SELinux policies, use the below commands.

# getsebool -a | grep samba
# getsebool -a | grep nmb

 

This should give a list of options and whether these are on or off. They should be on. The settings can be changed using the commands given below.

Syntax :

# setsebool -P [boolean] on

 

For example:

# setsebool -P bacula_use_samba on

 

Var dette svaret til hjelp? 0 brukere syntes dette svaret var til hjelp (0 Stemmer)