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

The Geek Diary

HowTos | Basics | Concepts

  • Solaris 11
  • Solaris
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VxVM
  • VCS
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting

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 : Managing password ageing for users using chage (with practical Examples)
  2. Understanding Basic File Permissions and ownership in Linux
  3. CentOS / RHEL 7 : How to sync chrony to local clock
  4. CentOS / RHEL 7 : How to check the status of a service using systemd
  5. How To Add New Disk to An Existing Diskgroup on RAC Cluster or Standalone ASM Configuration
  6. CentOS / RHEL 5 : How to password-protect single user mode
  7. CentOS / RHEL 7 : Enable NTP to start at boot after fresh install (disable chrony)
  8. Linux OS Service ‘named’
  9. Understanding Variables in Bash Shell Under Linux
  10. CentOS / RHEL 7 : How to Reset root password

You May Also Like

Primary Sidebar

Recent Posts

  • How to Check and Analyze Memory Usage in Solaris
  • Manual Changes Made To /etc/hosts Or /etc/sysconfig/network-scripts/ifcfg-* Are Lost
  • How to configure Partitioned Block Devices (Non-ASMLIB) And Assign Them To ASM
  • How to configure kdump in Oracle Enterprise Linux (OEL 5,6)
  • How To Create Device Alias For ASM Disks Using mknod On Linux/Unix

Footer

Cheat Sheets

  • LDOMs (OVM for SPARC) Command line reference
  • Solaris Volume Manager (SVM) command line reference
  • Solaris ZFS command line reference
  • RHEL 7 – RHCSA Notes (Cheat Sheets)
  • CentOS / RHEL 7 : firewalld Cheat Sheet
  • systemd command line reference (cheat sheet)

Solaris interview questions

  • The ultimate Solaris Volume Manager (SVM) interview questions
  • The ultimate Solaris zones (containers) interview questions
  • The ultimate Solaris networking interview questions
  • The ultimate ZFS interview questions
  • Archives
  • Contact Us
  • Copyright

© 2018 · The Geek Diary