• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 7 : Unable To Start The Samba Service

by admin

The Problem

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
How to enable/disable SELinux Modes in RHEL/CentOS

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

Filed Under: CentOS/RHEL 7, Linux, OEL 7

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to disable root login or root access on a system
  2. How to clear the buffer/pagecache (disk cache) under Linux
  3. pinky Command Examples in Linux
  4. CentOS / RHEL : How to remove used Physical Volume(PV) from Volume Group (VG) in LVM
  5. How to Connect Remote Host Using the ssh Command
  6. How to Enable Verbose Logging for VSFTPD
  7. kwriteconfig5 Command Examples in Linux
  8. lsof: command not found
  9. CentOS / RHEL 7 : How to password protect GRUB2 menu entries
  10. dirb Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright