[SOLVED] Error running a command. cmd at samba share screen

I don’t know witch branch I use. I use the install.iso from the web side, and so, I think it should be stable.

You wrote, that my settings have no systemctl restart. Should i change

systemctl('nmb', command)  <-- here the first
systemctl('smb', command)  <-- and the second

to

systemctl('nmb', restart)
systemctl('smb', restart)

Hi @Uwe_Ganswig, NO

this is the meaning of systemctl('nmb', command)

command is a variable with start/stop values, so don’t change it

When you download Rockstor ISO and perform installation it suggests having updates, if you don’t have stable subscription you can add only testing branch updates, have you done it? If not, please do it, perform updates then check again

M.

Hello @Flyer,

nothing changed the situation after updating to version .22

If I click the button to start samba follow error message comes out:

[root@gphomeserver2 ~]# systemctl status nmb.service
● nmb.service - Samba NMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fr 2016-10-21 12:51:28 CEST; 2min 51s ago
  Process: 26641 ExecStart=/usr/sbin/nmbd $NMBDOPTIONS (code=exited, status=1/FAILURE)
 Main PID: 26641 (code=exited, status=1/FAILURE)

Okt 21 12:51:28 gphomeserver2 systemd[1]: Starting Samba NMB Daemon...
Okt 21 12:51:28 gphomeserver2 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
Okt 21 12:51:28 gphomeserver2 systemd[1]: Failed to start Samba NMB Daemon.
Okt 21 12:51:28 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 21 12:51:28 gphomeserver2 systemd[1]: nmb.service failed.
[root@gphomeserver2 ~]# journalctl -xe
-- Unit nmb.service has failed.
--
-- The result is failed.
Okt 21 12:59:48 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 21 12:59:48 gphomeserver2 systemd[1]: nmb.service failed.
Okt 21 13:01:01 gphomeserver2 systemd[1]: Started Session 6 of user root.
-- Subject: Unit session-6.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-6.scope has finished starting up.
--
-- The start-up result is done.
Okt 21 13:01:01 gphomeserver2 systemd[1]: Starting Session 6 of user root.
-- Subject: Unit session-6.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-6.scope has begun starting up.
Okt 21 13:01:01 gphomeserver2 CROND[27155]: (root) CMD (run-parts /etc/cron.hourly)
Okt 21 13:01:01 gphomeserver2 run-parts(/etc/cron.hourly)[27158]: starting 0anacron
Okt 21 13:01:01 gphomeserver2 run-parts(/etc/cron.hourly)[27164]: finished 0anacron
Okt 21 13:01:01 gphomeserver2 run-parts(/etc/cron.hourly)[27166]: starting 0yum-hourly.cron

And since the update the localization error is back

Ok, actually failing service is nmb, so can you please provide nmb logs?

/var/log/samba/log.nmbd

Hello,

short update. I’ve reinstalled rockstor. Then patched the installation, activated the testing branch updates and installed them. After that I have had to install the patch again.

I hope samba run again after restart. :wink:

1 Like

What the hell …

I wanted to change the workgroup name.

    Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/smart_manager/views/samba_service.py", line 83, in post
    update_global_config(global_config, adconfig)
  File "/opt/rockstor/src/rockstor/system/samba.py", line 134, in update_global_config
    tfo.write('    %s = %s\n' % (k, ad_config[k]))
KeyError: 'workgroup'

Is Active Directory on?

No. And it does not matter if samba runs or not.

Sorry @Uwe_Ganswig, my fault (and I can’t solve it by now because github is down)

If you can : pls edit opt/rocksotr/src/rockstor/smart_manager/views/samba_service.py
line 72 and change it with adconfig = None

This is a workaround, will patch it asap (@suman pls wait with new release / or patch it if you get github access and no PR from me). Sorry again, my dev env had an ad config field filled or {}, but not Null so I didn’t catch it :pensive:

M.

3 Likes

OK, thanks for now… Hope it works all right after restart :smiley:

Hi @Uwe_Ganswig, got an on the fly test: with that line change setting workgroup works fine, meanwhile github up again :wink:

Cooking time, bye :slight_smile:

2 Likes

Hope your food was delicious.

So wtf. Started today the machine, open the webui, open the services and what should i say? Samba does’nt run. :rage:

Here are the error message that comes, if I try to activate them:

        Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/smart_manager/views/samba_service.py", line 104, 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.', '']
[root@gphomeserver2 ~]# systemctl status nmb.service
● nmb.service - Samba NMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sa 2016-10-22 10:19:14 CEST; 40s ago
  Process: 4414 ExecStart=/usr/sbin/nmbd $NMBDOPTIONS (code=exited, status=1/FAILURE)
 Main PID: 4414 (code=exited, status=1/FAILURE)

Okt 22 10:19:14 gphomeserver2 systemd[1]: Starting Samba NMB Daemon...
Okt 22 10:19:14 gphomeserver2 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
Okt 22 10:19:14 gphomeserver2 systemd[1]: Failed to start Samba NMB Daemon.
Okt 22 10:19:14 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 10:19:14 gphomeserver2 systemd[1]: nmb.service failed.

Here a dump from journalctl

Okt 22 10:19:14 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 10:19:14 gphomeserver2 systemd[1]: nmb.service failed.
Okt 22 10:19:14 gphomeserver2 polkitd[2345]: Unregistered Authentication Agent for unix-process:4403:23147 (system bus name :1.18, object path /org/free
Okt 22 10:30:22 gphomeserver2 systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Okt 22 10:30:22 gphomeserver2 systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
Okt 22 10:31:36 gphomeserver2 ntpd[2294]: 0.0.0.0 c612 02 freq_set kernel -51.153 PPM
Okt 22 10:31:36 gphomeserver2 ntpd[2294]: 0.0.0.0 c615 05 clock_sync
Okt 22 10:38:04 gphomeserver2 kernel: r8169 0000:04:00.0 enp4s0: link down
Okt 22 10:38:04 gphomeserver2 NetworkManager[2286]: <info>  (enp4s0): link disconnected (deferring action for 4 seconds)
Okt 22 10:38:07 gphomeserver2 kernel: r8169 0000:04:00.0 enp4s0: link up
Okt 22 10:38:07 gphomeserver2 NetworkManager[2286]: <info>  (enp4s0): link connected
lines 2790-2812/2812 (END)
Okt 22 10:19:14 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 10:19:14 gphomeserver2 systemd[1]: nmb.service failed.
Okt 22 10:19:14 gphomeserver2 polkitd[2345]: Unregistered Authentication Agent for unix-process:4403:23147 (system bus name :1.18, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale de_DE.UTF-8) (disconnected from bus)
Okt 22 10:30:22 gphomeserver2 systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Okt 22 10:30:22 gphomeserver2 systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
Okt 22 10:31:36 gphomeserver2 ntpd[2294]: 0.0.0.0 c612 02 freq_set kernel -51.153 PPM
Okt 22 10:31:36 gphomeserver2 ntpd[2294]: 0.0.0.0 c615 05 clock_sync
Okt 22 10:38:04 gphomeserver2 kernel: r8169 0000:04:00.0 enp4s0: link down
Okt 22 10:38:04 gphomeserver2 NetworkManager[2286]: <info>  (enp4s0): link disconnected (deferring action for 4 seconds)
Okt 22 10:38:07 gphomeserver2 kernel: r8169 0000:04:00.0 enp4s0: link up
Okt 22 10:38:07 gphomeserver2 NetworkManager[2286]: <info>  (enp4s0): link connected

Good : workgroup working :smiley:
Bad : nmbd not working :rage:

Let’s check it:
cat /var/log/samba/log.nmbd and
journalctl -u nmb.service

Add: are you running a Realtek Nic? I don’t like that r8169, had it on Debian, had it on Centos and always had to move to r8168 (r8169 is a well known buggy one). Here a small howto http://unix.stackexchange.com/questions/108952/realtek-r8169-not-working-in-centos-6-5

The network controller is a rtl8111g.

Here come the logs

[root@gphomeserver2 ~]# cat /var/log/samba/log.nmbd
[2016/10/21 19:46:44,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/21 19:46:44.996711,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2016/10/21 19:47:07.023052,  0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server GPHOMESERVER2 is now a local master browser for workgroup MYGROUP on subnet 192.168.177.35

  *****
[2016/10/21 20:09:15.488902,  0] ../source3/nmbd/nmbd.c:58(terminate)
  Got SIGTERM: going down...
[2016/10/21 20:09:40,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/21 20:09:40.693886,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2016/10/21 20:10:03.719087,  0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server GPHOMESERVER2 is now a local master browser for workgroup MYGROUP on subnet 192.168.177.35

  *****
[2016/10/21 20:58:45.180364,  0] ../source3/nmbd/nmbd.c:58(terminate)
  Got SIGTERM: going down...
[2016/10/21 20:59:42,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/21 20:59:42.976431,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2016/10/21 21:00:06.004246,  0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server GPHOMESERVER2 is now a local master browser for workgroup MYGROUP on subnet 192.168.177.35

  *****
[2016/10/21 21:08:35.578590,  0] ../source3/nmbd/nmbd.c:58(terminate)
  Got SIGTERM: going down...
[2016/10/21 21:09:27,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/21 21:09:27.863722,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2016/10/21 21:09:50.889434,  0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server GPHOMESERVER2 is now a local master browser for workgroup MYGROUP on subnet 192.168.177.35

  *****
[2016/10/21 21:19:32.540059,  0] ../source3/nmbd/nmbd.c:58(terminate)
  Got SIGTERM: going down...

************** A new day ... with bad news *******************

[2016/10/22 10:15:55,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/22 10:15:55,  0] ../source3/nmbd/nmbd.c:912(main)
  error opening config file '/etc/samba/smb.conf'
[2016/10/22 10:18:00,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/22 10:18:00,  0] ../source3/nmbd/nmbd.c:912(main)
  error opening config file '/etc/samba/smb.conf'
[2016/10/22 10:19:14,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/22 10:19:14,  0] ../source3/nmbd/nmbd.c:912(main)
  error opening config file '/etc/samba/smb.conf'
[2016/10/22 11:03:11,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/22 11:03:11,  0] ../source3/nmbd/nmbd.c:912(main)
  error opening config file '/etc/samba/smb.conf'
[2016/10/22 11:11:43,  0] ../source3/nmbd/nmbd.c:908(main)
  nmbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/22 11:11:43,  0] ../source3/nmbd/nmbd.c:912(main)
  error opening config file '/etc/samba/smb.conf'
[/code
]
Here  the log from journalctl

[code] [root@gphomeserver2 ~]# journalctl -u nmb.service
-- Logs begin at Sa 2016-10-22 12:15:23 CEST, end at Sa 2016-10-22 12:01:01 CEST. --
Okt 22 10:15:51 gphomeserver2 systemd[1]: Starting Samba NMB Daemon...
Okt 22 10:15:55 gphomeserver2 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
Okt 22 10:15:55 gphomeserver2 systemd[1]: Failed to start Samba NMB Daemon.
Okt 22 10:15:55 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 10:15:55 gphomeserver2 systemd[1]: nmb.service failed.
Okt 22 10:18:00 gphomeserver2 systemd[1]: Starting Samba NMB Daemon...
Okt 22 10:18:00 gphomeserver2 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
Okt 22 10:18:00 gphomeserver2 systemd[1]: Failed to start Samba NMB Daemon.
Okt 22 10:18:00 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 10:18:00 gphomeserver2 systemd[1]: nmb.service failed.
Okt 22 10:19:14 gphomeserver2 systemd[1]: Starting Samba NMB Daemon...
Okt 22 10:19:14 gphomeserver2 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
Okt 22 10:19:14 gphomeserver2 systemd[1]: Failed to start Samba NMB Daemon.
Okt 22 10:19:14 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 10:19:14 gphomeserver2 systemd[1]: nmb.service failed.
Okt 22 11:03:11 gphomeserver2 systemd[1]: Starting Samba NMB Daemon...
Okt 22 11:03:11 gphomeserver2 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
Okt 22 11:03:11 gphomeserver2 systemd[1]: Failed to start Samba NMB Daemon.
Okt 22 11:03:11 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 11:03:11 gphomeserver2 systemd[1]: nmb.service failed.
Okt 22 11:11:43 gphomeserver2 systemd[1]: Starting Samba NMB Daemon...
Okt 22 11:11:43 gphomeserver2 systemd[1]: nmb.service: main process exited, code=exited, status=1/FAILURE
Okt 22 11:11:43 gphomeserver2 systemd[1]: Failed to start Samba NMB Daemon.
Okt 22 11:11:43 gphomeserver2 systemd[1]: Unit nmb.service entered failed state.
Okt 22 11:11:43 gphomeserver2 systemd[1]: nmb.service failed.

Ok, let’s see if the onboard network adapter is the bad boy.

I test it now with a USB network adapter

Unfortunately, it is not the onboard adapter. Also with the USB-NIC comes the error message.

Ok, can you please post here your etc/samba/smb.conf file?

I don’t think (hope) this to be strictly related to Rockstor code

[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 = HOMEOFFICE
####END: Rockstor SAMBA GLOBAL CUSTOM####

What if samba starts before network is ready?

1 Like

That’s what I was thinking too, but the problem is I don’t know what the problem is at the moment. :cry: It keeps complaining about smb.conf, but I don’t see anything wrong and neither did testparm.

Nice question: googling found some people having same issue because of samba starting before network is ready. No network -> samba dies