[SOLVED]Failed to start samba due to a system error - SELinux related

Brief description of the problem

Unable to start Samba

Detailed step by step instructions to reproduce the problem

Try to start Samba service via Rockstor web console

Web-UI screenshot

Error Traceback provided on the Web-UI

Traceback (most recent call last): File "/opt/rockstor/src/rockstor/smart_manager/views/samba_service.py", line 107, in post systemctl('nmb', command) File "/opt/rockstor/src/rockstor/system/services.py", line 64, in systemctl return run_command([SYSTEMCTL_BIN, switch, service_name]) File "/opt/rockstor/src/rockstor/system/osi.py", line 109, in run_command raise CommandException(cmd, out, err, rc) CommandException: Error running a command. cmd = ['/usr/bin/systemctl', 'start', 'nmb']. rc = 1. stdout = ['']. stderr = ['Job for nmb.service failed because the control process exited with error code. See "systemctl status nmb.service" and "journalctl -xe" for details.', '']

Hi @Alan_A and welcome to Rockstor :smiley:
Can you please provide more log with systemctl status nmb ?

Thanks
Mirko

Sure, output is below. Thanks!

nmb.service - Samba NMB Daemon
Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-01-09 19:56:01 AEDT; 4min 40s ago
Main PID: 13178 (code=exited, status=1/FAILURE)

Jan 09 19:56:01 chopsstorage3 systemd[1]: Starting Samba NMB Daemon…
Jan 09 19:56:01 chopsstorage3 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILU RE
Jan 09 19:56:01 chopsstorage3 systemd[1]: Failed to start Samba NMB Daemon.
Jan 09 19:56:01 chopsstorage3 systemd[1]: Unit nmb.service entered failed state.
Jan 09 19:56:01 chopsstorage3 systemd[1]: nmb.service failed.

Hi @Alan_A, this doesn’t help us :angry:

We can try this
journalctl -xe | grep nmb
journalctl -xe | grep smb

then reading some log:
tail -n 100 /var/log/samba/log.nmbd
tail -n 100 /var/log/samba/log.smbd

I only got output from the journalctl -xe | grep nmb. The other three commands returned nothing. Checking the /var/log/samba directory, and the two log files are 0 size.

– Subject: Unit nmb.service has begun start-up
– Unit nmb.service has begun starting up.
Jan 10 19:42:22 chopsstorage3 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
– Subject: Unit nmb.service has failed
– Unit nmb.service has failed.
Jan 10 19:42:22 chopsstorage3 systemd[1]: Unit nmb.service entered failed state.
Jan 10 19:42:22 chopsstorage3 systemd[1]: nmb.service failed.

Hi @Alan_A this doesn’t help us :unamused:

Can you please check with journactl -r if you find something about nmb or smb??

Meanwhile, can you try to ping www.google.com (just to check another net issue)

M.

Sorry, I dont see anything in there that is related

I can ping google and other sites ok. Im able to install Rock-Ons so network access is good

1 Like

Ok, next step:
can you post your smb.conf file?
M.

[global]
log level = 3
map to guest = Bad User
cups options = raw
log file = /var/log/samba/log.%m
printcap name = /dev/null
load printers = no

####BEGIN: Rockstor SAMBA GLOBAL CUSTOM####
workgroup = CHOPSNET
####END: Rockstor SAMBA GLOBAL CUSTOM####

Hi @Alan_A,
your smb.conf is simple and ok too, so this unfortunately doesn’t help us :confused:

Let’s start over: can you describe steps you to raise that error?

M.

Sure. It’s a fresh install on a new machine, clean drive. I’ve booted up after install, accepted the license, created admin account etc.Created a pool, then installed a couple of RockOns (OwnCloud and OpenVPN) but not configured them yet.
Subscribe to stable updates and do an update.

I want to start creating some shares, and notice that Samba isnt running, try to start the service (System > Services > Click slider to on) and it fails. Click the spanner icon against Samba to see what options therre are (not many!) and enter my local Workgroup name. Click submit - get error.

Uhmmm, stupid question of the day:

did you performed a reboot?

M.

Not a stupid question, but I have rebooted. I’ve just done another one to be 100% sure, and still same issue.

Ok, we must at least have some logs so please add here (or upload online and provide links) for
/var/log/samba/log.nmbd and /var/log/samba/log.smbd

Mirko

Ok, Hagakure mode on:

systemctl restart nmb +
dmesg

Both log files are still empty
Output from dmesg is

Hi @Alan_A can you start other services like ntp??
First thing i noticed is that eth0 renaming and SELinux:

can you check current SELinux status with sestatus -v ?

Another question: are you running Rockstor in a VM or on bare metal?

M.

I’m running on bare metal, and yes, I seem to be able to start ntp, nfs etc.

I dont know why the eth0 would be getting renamed - should I try disabling ipv6 perhaps? There are 2 NICs in this box, but only using one, and I just accepted the default config

sestatus output is

SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30

Process contexts:
Current context: unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Init context: system_u:system_r:init_t:s0
/usr/sbin/sshd system_u:system_r:sshd_t:s0-s0:c0.c1023

File contexts:
Controlling terminal: unconfined_u:object_r:user_devpts_t:s0
/etc/passwd system_u:object_r:passwd_file_t:s0
/etc/shadow system_u:object_r:shadow_t:s0
/bin/bash system_u:object_r:shell_exec_t:s0
/bin/login system_u:object_r:login_exec_t:s0
/bin/sh system_u:object_r:bin_t:s0 -> system_u:object_r:shell_exec_t:s0
/sbin/agetty system_u:object_r:getty_exec_t:s0
/sbin/init system_u:object_r:bin_t:s0 -> system_u:object_r:init_exec_t:s0
/usr/sbin/sshd system_u:object_r:sshd_exec_t:s0

Hi @Alan_A, actually some Rockstors get SELinux while Rockstor default has SELinux disabled.

Good reading about this (how to disable it or have it permissive, thanks to @magicalyak howto!) : SELinux and SMB shares unavailable after upgrade to 3.8.15 - #16 by magicalyak

Pls update us :slight_smile:
Mirko

1 Like

Bingo. The man’s a genius, thanks very much. I didnt even know what SELinux was, so had to go and do a bit of googling. Looking through the post you linked to, i set it to permissive mode and straight away I was able to start Samba.

I’ve edited the config file to set it to permissive (presumably this makes it permanent rather than just for the current boot cycle) One comment on the linked post recommended not disabling it, any thoughts? Im guessing if it’s not supposed to be on by default, it’s not an issue to disable it?

1 Like