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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Unable to start Nagios Service (CentOS/RHEL)
  2. How to disable NetworkManager on CentOS / RHEL 7
  3. How to Replace a Failed Btrfs Device
  4. LVM Configuration : Volume Group (VG) Operations/Utilities
  5. How To Change Timezone for Oracle Grid Infrastructure
  6. How to Boot into Rescue Mode or Emergency Mode Through Systemd in CentOS/RHEL 7 and 8
  7. Understanding How Umask Controls the Initial File / Directory Permissions in Linux
  8. Understanding The sysfs File System (/sys) in Linux
  9. pvcreate error : Can’t open /dev/sdx exclusively. Mounted filesystem?
  10. How to Run DNS and FTP services in a chroot Jail

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary