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

Hello everybody, the localization faults seem to be solved after patching the mashine.

Now, the next error.

After adding two more hdds as raid0 pool and apend as a share I would do a samba share. After clicking submit the errorbox comes.

[ Traceback (most recent call last): File "/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py", line 40, in _handle_exception yield File "/opt/rockstor/src/rockstor/storageadmin/views/samba.py", line 156, in post self._restart_samba() File "/opt/rockstor/src/rockstor/storageadmin/views/samba.py", line 52, in _restart_samba restart_samba(hard=True) File "/opt/rockstor/src/rockstor/system/samba.py", line 146, in restart_samba run_command([SYSTEMCTL, mode, 'smb']) File "/opt/rockstor/src/rockstor/system/osi.py", line 103, in run_command raise CommandException(cmd, out, err, rc) CommandException: Error running a command. cmd = ['/usr/bin/systemctl', 'restart', 'smb']. rc = 1. stdout = ['']. stderr = ['Job for smb.service failed because the control process exited with error code. See "systemctl status smb.service" and "journalctl -xe" for details.', '']

Hi @Uwe_Ganswig can you please post here journalctl -xe

Had a new samba share and it seems ok/not related to locale

Mirko

Using username "root".
Last login: Wed Oct 19 14:15:53 2016 from gpworkstation.fritz.box
[root@gphomeserver2 ~]# journalctl -xe
-- Subject: A new session 3 has been created for user root
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A new session with the ID 3 has been created for the user root.
--
-- The leading process of the session is 7474.
Okt 19 15:36:16 gphomeserver2 systemd[1]: Started Session 3 of user root.
-- Subject: Unit session-3.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-3.scope has finished starting up.
--
-- The start-up result is done.
Okt 19 15:36:16 gphomeserver2 systemd[1]: Starting Session 3 of user root.
-- Subject: Unit session-3.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-3.scope has begun starting up.
Okt 19 15:36:16 gphomeserver2 sshd[7474]: pam_unix(sshd:session): session opened

[root@gphomeserver2 ~]# journalctl -xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nmb.service has finished starting up.
--
-- The start-up result is done.
Okt 19 15:38:58 gphomeserver2 systemd[1]: Starting Samba SMB Daemon...
-- Subject: Unit smb.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit smb.service has begun starting up.
Okt 19 15:38:58 gphomeserver2 systemd[1]: smb.service: main process exited, code
Okt 19 15:38:58 gphomeserver2 systemd[1]: Failed to start Samba SMB Daemon.
-- Subject: Unit smb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit smb.service has failed.
--
-- The result is failed.
Okt 19 15:38:58 gphomeserver2 systemd[1]: Unit smb.service entered failed state.
Okt 19 15:38:58 gphomeserver2 systemd[1]: smb.service failed.

[root@gphomeserver2 ~]# -- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit smb.service has failed.
--
-- The result is failed.
Okt 19 15:38:58 gphomeserver2 systemd[1]: Unit smb.service entered failed state.
Okt 19 15:38:58 gphomeserver2 systemd[1]: smb.service failed.-bash: --: Kommando nicht gefunden.

Can you please provide systemctl status smb.service too? thx

What happen if you start/stop samba service from Rockstor Web UI?

Addendum: had same command on a python shell with env hack and it exited 0 without problems, so not related to new run_command hack

M.

Hello @Flyer at this time I’ve a new problem. After install MariaDB, I can’t connect to any service nor webui. And system restore option, tell me, after a short time, that there are no linux filesystems found.

And these errormessage came at start samba too.

I think I must reinstall rockstor and patch it again. Please stay tuned :smiley:

Thanks for now

:confused: ?? Are you having MariaDB directly over Rockstor??
My suggestion: have it in a Rock-on

Flyer

No, I’ve had as Rock-on :wink:

Ok, wait.
This is related to rock-ons and better to ask other users (@phillxnet, @sfranzen, @bug11 ) having more confidence with rock-ons.

Back to samba / errors / etc:
Is your Rockstor environment ok with patch & without rock-ons?

Mirko

Hi Mirko, I’ve a big problem. After fresh install all seem ok.Samba run and shares are working.
After reboot samba give me a shoot in my heart.

If I try to activate SMB under services the known error message comes.

Here the status message

[root@gphomeserver2 ~]# systemctl status smb.service
â—Ź smb.service - Samba SMB Daemon
   Loaded: loaded (/etc/systemd/system/smb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mi 2016-10-19 19:55:36 CEST; 5min ago
 Main PID: 3988 (code=exited, status=1/FAILURE)

Okt 19 19:55:35 gphomeserver2 systemd[1]: Starting Samba SMB Daemon...
Okt 19 19:55:36 gphomeserver2 systemd[1]: smb.service: main process exited, code=exited, status=1/FAILURE
Okt 19 19:55:36 gphomeserver2 systemd[1]: Failed to start Samba SMB Daemon.
Okt 19 19:55:36 gphomeserver2 systemd[1]: Unit smb.service entered failed state.
Okt 19 19:55:36 gphomeserver2 systemd[1]: smb.service failed.

Ok, so SMB fails consistently but for unknown reasons. Could you check if /var/log/samba/log.smbd contains more specific info?

1 Like

Here is the log

[2016/10/19 19:26:33,  0] ../source3/smbd/server.c:1241(main)
  smbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/19 19:26:34.900338,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/10/19 19:26:34.911622,  0] ../source3/printing/print_cups.c:151(cups_connect)
  Unable to connect to CUPS server localhost:631 - Der Socket ist nicht verbunden
[2016/10/19 19:26:34.911784,  0] ../source3/printing/print_cups.c:529(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
[2016/10/19 19:35:35.352846,  0] ../source3/printing/print_cups.c:151(cups_connect)
  Unable to connect to CUPS server localhost:631 - Der Socket ist nicht verbunden
[2016/10/19 19:35:35.353411,  0] ../source3/printing/print_cups.c:529(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
[2016/10/19 19:48:35.962379,  0] ../source3/printing/print_cups.c:151(cups_connect)
  Unable to connect to CUPS server localhost:631 - Der Socket ist nicht verbunden
[2016/10/19 19:48:35.964158,  0] ../source3/printing/print_cups.c:529(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
[2016/10/19 19:53:32.850686,  0] ../lib/util/pidfile.c:153(pidfile_unlink)
  Failed to delete pidfile /run/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
[2016/10/19 19:53:32,  0] ../source3/smbd/server.c:1241(main)
  smbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/19 19:53:32,  0] ../source3/smbd/server.c:1256(main)
  error opening config file '/etc/samba/smb.conf'
[2016/10/19 19:55:36,  0] ../source3/smbd/server.c:1241(main)
  smbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/19 19:55:36,  0] ../source3/smbd/server.c:1256(main)
  error opening config file '/etc/samba/smb.conf'
[2016/10/19 21:24:50,  0] ../source3/smbd/server.c:1241(main)
  smbd version 4.2.10 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2014
[2016/10/19 21:24:50,  0] ../source3/smbd/server.c:1256(main)
  error opening config file '/etc/samba/smb.conf'

Thx @sfranzen!
Next step: cat /etc/samba/smb.conf

It seems samba doesn’t like your conf file

Getting somewhere! :sunglasses: Another useful utility for samba is testparm, it should tell you what is wrong with it.

Hei @Uwe_Ganswig,
no news good news? :smiley:

M.

No, Samba will not start. Not in the WebUI and also not at the console.

[root@gphomeserver2 ~]# cat /etc/samba/smb.conf
[global]
    workgroup = HOMEOFFICE
    log file = /var/log/samba/log.%m
    log level = 3
    load printers = no
    cups options = raw
    printcap name = /dev/null
[root@gphomeserver2 ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        workgroup = HOMEOFFICE
        log file = /var/log/samba/log.%m
        load printers = No
        printcap name = /dev/null
        idmap config * : backend = tdb
        cups options = raw

In my despair, I have now seen some configuration files.

In the samba_service.py I marked two entries as a comment at the end of the file. Samba is still not started, but the error box does not come anymore :stuck_out_tongue:

  else:
            try:
                if (command == 'stop'):
                    systemctl('smb', 'disable')
                    systemctl('nmb', 'disable')
                else:
                    systemd_name = '%s.service' % service_name
                    ss_dest = ('/etc/systemd/system/%s' % systemd_name)
                    ss_src = ('%s/%s' % (settings.CONFROOT, systemd_name))
                    sum1 = md5sum(ss_dest)
                    sum2 = md5sum(ss_src)
                    if (sum1 != sum2):
                        shutil.copy(ss_src, ss_dest)
                    systemctl('smb', 'enable')
                    systemctl('nmb', 'enable')
                """
		systemctl('nmb', command)  <-- here the first
                systemctl('smb', command)  <-- and the second
				"""
            except Exception, e:
                e_msg = ('Failed to %s samba due to a system error: %s' % (command, e.__str__()))
                handle_exception(Exception(e_msg), request)
        return Response()

Ok tomorrow going to check systemctl command (maybe missing env)

M.

Hi @Uwe_Ganswig you don’t have errors because errors are inside systemctl restart eheh
…but having no systemctl smb and nmb don’t restart (that’s why you don’t have samba)

It’s really strange, actually had my dev env out of Active Directory running simple samba and it seems fine. Are you on stable branch or testing branch?

M.

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)