Latest News:
2019-03-31: XigmaNAS 11.2.0.4.6625 - released!

Latest BETA Release:
2019-03-31: XigmaNAS 12.0.0.4.6625 - BETA released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS cost money, please consider a donation to our project so we can continue to offer you the best.
We need your support! eg: PAYPAL

New WSD Discovery for Samba Shares

Post/Debate your Suggestions & Requests of XigmaNAS here. This ONLY pertains to XigmaNAS.
Forum rules
Set-Up GuideFAQsForum Rules
sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

New WSD Discovery for Samba Shares

#1

Post by sleyk2010 » 09 Mar 2019 16:36

Hello,

I wanted to ask/make a suggestion for a feature to be included in upcoming releases if not already included.

As you know, Windows 10 got rid of Samba 1.0 and with it, the local master browser.

Windows 10 now uses new WSD discovery method to browse and see shares from other windows clients/pc's.

Yes you can enable samba 1.0 if need, but i believe it to be unsafe now? Also it is advised to turn off netbios with tcp/ip as it is old code now and windows doesn't need it anymore. Only samba 1.0 relied on it.

non windows devices (xigmanas, freenas, synology etc.) do not show up for me anymore. This is due to fact that xigma doesnt have WSD service discovery feature enabled/implemented by default?

Further, cifs/smb service in xigmanas gives option for local master broswer, but if have windows 10 pc 1703/1709 build or later, local master browser has no effect since turned off in windows, and once netbios disabled, non windows system is "invisible" thus windows 10 pc's do not see xigmanas in network neighborhood.

Yes, you can map shares from xigmanas, but i would like to browse and see my pc and all the servers i have on my network.

I included a link here to a script this guy created: https://github.com/christgau/wsdd its from github where xigma developers can include to base system of xigma or in samba or as a daemon to allow nas system to be seen and discovered in windows network discovery neighborhood through the new wd discovery method.

I haven't found a way to test if this is already enabled in xigma, so please dont be upset at me for suggesting! :)

It seems to be built in python and it looks simple and easy to implement, i just don't know how to do myself, but i think all users can benefit, and if not needed, can be option to disable.

I think this will solve the problem many have with not being able to browse shares on network with windows 10/8/7 pc's if netbios and samba 1.0 is turned off.

Also not necessary to read, but if have a few moments, a good resource from Freenas Forum: https://www.ixsystems.com/community/res ... -ever.106/

doktornotor
Advanced User
Advanced User
Posts: 176
Joined: 16 May 2017 00:22
Status: Offline

Re: New WSD Discovery for Samba Shares

#2

Post by doktornotor » 13 Mar 2019 09:07

A huge amount of code was contributed to Samba upstream to get WSD working -- and subsequently absolutely wasted due to ignoring the contribution for years... :x :cry:

https://bugzilla.samba.org/show_bug.cgi?id=11473

+1 from me getting something into XigmaNAS, the upstream road obviously won't get us anywhere. (Similar python-based stuff is shipped e.g. with QNAP.)

Brahiewahiewa
NewUser
NewUser
Posts: 13
Joined: 01 Aug 2012 15:54
Status: Offline

Re: New WSD Discovery for Samba Shares

#3

Post by Brahiewahiewa » 14 Mar 2019 09:08

doktornotor wrote:
13 Mar 2019 09:07
...
+1 from me getting something into XigmaNAS, the upstream road obviously won't get us anywhere. (Similar python-based stuff is shipped e.g. with QNAP.)
I second that opinion

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#4

Post by sleyk2010 » 14 Mar 2019 13:22

It is truly a shame this was presented to the Samba team since August 2015 and this was ignored. Especially since most of the hard work was done for them already.

Thanks to both of you for supporting this. I hope the Devs can see this and maybe implement this on the next build. I think FreeNas is also working on implementing this for their next build and I believe their nightlies already have it for users to test out.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4833
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: New WSD Discovery for Samba Shares

#5

Post by raulfg3 » 14 Mar 2019 15:49

+1

it's weird can't use names and need to use IP
12.0.0.4 - BETA (revision 6625)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes
Old Wiki

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#6

Post by sleyk2010 » 17 Mar 2019 14:12

Thanks for the +1 Raulf, Yeah I too now have to browse by IP address just to find my shares. The problem for me is that I have shared folders for my fiance and for her, its not easy to browse, much less search by ip address. Also, even mapping drives sometimes fail, not often, but they do occasionally not allow her to see the shares.

Forget it if you have more then one nas or server at home.

If any of you guys have some star power with the devs, give them a buzz or a ring and see if we can get some more eyes on this. I feel like this is a much needed feature for Xigmanas now and I think it will eliminate many of the SMB/shares/explorer problems users may face.

netware5
experienced User
experienced User
Posts: 93
Joined: 31 Jan 2017 21:39
Location: Sofia, BULGARIA
Status: Offline

Re: New WSD Discovery for Samba Shares

#7

Post by netware5 » 17 Mar 2019 15:05

I've attempted to manually test the script above, but failed due to the Pyton version. The script requires Pyton3, which seems to be not available in Xigmanas 11.2.0.4.6400.
XigmaNAS 11.2.0.4 - Omnius (rev.6625) embedded on HP Proliant Microserver Gen8, Xeon E3-1265L, 16 GB ECC, 2x4TB WD Red ZFS Mirror

Brahiewahiewa
NewUser
NewUser
Posts: 13
Joined: 01 Aug 2012 15:54
Status: Offline

Re: New WSD Discovery for Samba Shares

#8

Post by Brahiewahiewa » 18 Mar 2019 15:28

netware5 wrote:
17 Mar 2019 15:05
... The script requires Pyton3, which seems to be not available in Xigmanas 11.2.0.4.6400.
Did you run

Code: Select all

pkg install python3
?

netware5
experienced User
experienced User
Posts: 93
Joined: 31 Jan 2017 21:39
Location: Sofia, BULGARIA
Status: Offline

Re: New WSD Discovery for Samba Shares

#9

Post by netware5 » 18 Mar 2019 16:23

Brahiewahiewa wrote:
18 Mar 2019 15:28
netware5 wrote:
17 Mar 2019 15:05
... The script requires Pyton3, which seems to be not available in Xigmanas 11.2.0.4.6400.
Did you run

Code: Select all

pkg install python3
?
I am using Xigmanas embedded, so installation of any packages is useless.
XigmaNAS 11.2.0.4 - Omnius (rev.6625) embedded on HP Proliant Microserver Gen8, Xeon E3-1265L, 16 GB ECC, 2x4TB WD Red ZFS Mirror

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#10

Post by sleyk2010 » 18 Mar 2019 18:15

I suppose next step would be if anyone has virtual machine to run test in full installation?

doktornotor
Advanced User
Advanced User
Posts: 176
Joined: 16 May 2017 00:22
Status: Offline

Re: New WSD Discovery for Samba Shares

#11

Post by doktornotor » 19 Mar 2019 16:48

Python 2.7 is getting EOLed by the end of this year, so... needs to get replaced anyway.

netware5
experienced User
experienced User
Posts: 93
Joined: 31 Jan 2017 21:39
Location: Sofia, BULGARIA
Status: Offline

Re: New WSD Discovery for Samba Shares

#12

Post by netware5 » 27 Mar 2019 15:37

I've tested it and confirm that it is working. I installed Python3 on my embedded XigmaNAS and everything is fine. My Windows 10 laptop can see XigmaNAS server and browse the shares in Network Neighborhood using WSD Discovery. Of course the Python3 installation is not able to survive reboot on embedded system :)

So I will appreciate Python3 and WSDD script to be included in XigmaNAS.
XigmaNAS 11.2.0.4 - Omnius (rev.6625) embedded on HP Proliant Microserver Gen8, Xeon E3-1265L, 16 GB ECC, 2x4TB WD Red ZFS Mirror

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#13

Post by sleyk2010 » 01 Apr 2019 18:02

Excellent work Netware. This is excellent news. I'm glad you got it working.

Devs, please include WSD discovery along with Python 3 to Xigmanas.

In the meantime, @Netware5, Can you share steps how you did this? I can use this temporarily as a stop gap until Dev support in Xigmanas as I don't reboot too often.

netware5
experienced User
experienced User
Posts: 93
Joined: 31 Jan 2017 21:39
Location: Sofia, BULGARIA
Status: Offline

Re: New WSD Discovery for Samba Shares

#14

Post by netware5 » 01 Apr 2019 19:26

sleyk2010 wrote:
01 Apr 2019 18:02
Excellent work Netware. This is excellent news. I'm glad you got it working.

Devs, please include WSD discovery along with Python 3 to Xigmanas.

In the meantime, @Netware5, Can you share steps how you did this? I can use this temporarily as a stop gap until Dev support in Xigmanas as I don't reboot too often.
Just followed the instructions in posts #1 and #8.

First step is installation of Python3. Login as root and type in the terminal:

Code: Select all

pkg install python3
Second step is to copy the wsdd.py somewhere. I used the default location described in https://github.com/christgau/wsdd - "/usr/local/bin/wsdd". Don't forget to change the file permissions:

Code: Select all

chmod 0555 /usr/local/bin/wsdd/wsdd.py
Third step is to run the script. Login as root and type in the terminal:

Code: Select all

/usr/local/bin/wsdd/wsdd.py -v -w <name of your workgroup>& 
Please note that all this stuff will not survive reboot of embedded installation. So you should do all steps again after any reboot.
XigmaNAS 11.2.0.4 - Omnius (rev.6625) embedded on HP Proliant Microserver Gen8, Xeon E3-1265L, 16 GB ECC, 2x4TB WD Red ZFS Mirror

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4833
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: New WSD Discovery for Samba Shares

#15

Post by raulfg3 » 01 Apr 2019 20:02

only to know: OMV have WSD implemented only two weeks ago, and works fine and as expected.
12.0.0.4 - BETA (revision 6625)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes
Old Wiki

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#16

Post by sleyk2010 » 02 Apr 2019 00:48

@Raulfg this is good, I hope we are not last to support this... ;)

Thanks @Netware, will try this afternoon

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#17

Post by sleyk2010 » 02 Apr 2019 02:06

Praise the LORD. It works.

I finally see my long lost servers on my home network, without resorting to IP ADDRESSES.

Hostname resolving extremely fast.

Instructions are simple, script works well.

We just need implementation in Stable release of Xigmanas so package and script can survive reboot and maintain persistence in system.
Of note, Python3 package doesn't appear to be too large, so shouldn't be a problem to add to base system I think.

Some Notes:

1. I turned off TCP/IP over Netbios under my NIC adapter properties (WINS/DNS settings) under Windows. This forces Windows to use WSD method instead of Netbios (Old Method).
2. I turned off SMB1 in Windows, and ensured SMB Direct (Win 10) was enabled. No more worries of Security problems under old version SMB.
3. I turned off Local and Domain Master Browser under CIFS/SAMBA service in Xigmanas, as WSD discovery doesn't use old Master Browser anymore. No more Master elections. (No Collusion! :D)
4. Once you make all the changes, restart CIFS/SMB service in Xigmanas. Hostnames didn't show up for me until I did this.

As far as this goes, I will just avoid restart/shutdown/reboot unless absolutely necessary. If have to shutdown, command syntax isn't hard to get going again, as I already have the file saved in: /usr/local/bin

Thanks to Netware for taking the plunge on this first.

doktornotor
Advanced User
Advanced User
Posts: 176
Joined: 16 May 2017 00:22
Status: Offline

Re: New WSD Discovery for Samba Shares

#18

Post by doktornotor » 02 Apr 2019 23:31

Tested in an AD environment, works great as a post-init script (System > Advanced > Command Scripts)

Code: Select all

/usr/sbin/daemon -u daemon -r -p /var/run/wsdd.pid -P /var/run/wsdd_daemon.pid -S /usr/local/bin/wsdd.py -v -d MYDOMAIN
(See daemon(8) for options.)

netware5
experienced User
experienced User
Posts: 93
Joined: 31 Jan 2017 21:39
Location: Sofia, BULGARIA
Status: Offline

Re: New WSD Discovery for Samba Shares

#19

Post by netware5 » 03 Apr 2019 09:22

doktornotor wrote:
02 Apr 2019 23:31
Tested in an AD environment, works great as a post-init script (System > Advanced > Command Scripts)
.....
Thanks for the post-init script information. We are moving forward :) As the wsdd.py script could be easily copied somewhere in persistent location (like Zpool) and will survive reboot, seems to be that absence of python3 is the only thing preventing persistent installation on embedded configurations. It is not very feasible to perform python3 package installation during every reboot.
XigmaNAS 11.2.0.4 - Omnius (rev.6625) embedded on HP Proliant Microserver Gen8, Xeon E3-1265L, 16 GB ECC, 2x4TB WD Red ZFS Mirror

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#20

Post by sleyk2010 » 03 Apr 2019 23:17

Agree. this looks good so far. The post-init script is a good idea. I will mess around with that to see what I can do.

Dare I say, we can also setup a post init script to install package python3 as post init as well?

I don't believe the usr/local/bin directory is persistent to survive reboots, although I haven't tested, as I haven't rebooted as yet, so I will just copy script to Data drive.

Then I can try to make a post init command to run script from there.
Last edited by sleyk2010 on 04 Apr 2019 04:49, edited 1 time in total.

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#21

Post by sleyk2010 » 04 Apr 2019 00:08

Ok, I figured it out. This works well. Huge Thanks to @Netware3 for initial testing and @Doktornator for the postinit idea. I was able to create a series of 4 commands under post init that allow it to self install quietly after every reboot.

I successfully tested on my own live machine and it works well. I wrote this all out to help newcomers seeking answer to this issue. Please read to the end!
I will also create another thread and post this somewhere I think people can see easier.

I got this to work and the goal is to make it survive an embedded install reboot (Well, rather to make Xigmanas install it after every reboot without user intervention)

Ok, so first thing, for this to work, you have to have an internet connection so that Xigma can download Python3 from the online repository. Then go here and download the WSD script
https://github.com/christgau/wsdd click on the green button on the right that says "clone or download" and download it to your pc as a zip. Unzip with your favorite unzip program. (I personally love and use 7zip. I used to use winace, but it got old :cry: )

Save the wsdd.py script found in src folder to a persistent directory in Xigmanas that you know will survive a reboot. I created a folder and placed the script in my data partition under a folder named wsdd (/mnt/Data1/wsdd) Once there, I know it will always be there to run from, all that's left is to install python3 package and point it to your saved directory.

Now we start by creating these commands under postinit one by one: (Navigate to System > Advanced > Command Scripts in Xigmanas)

Code: Select all

pkg install -q -y python3
the -q switch (quiet/silent install) is important as it lets you install the entire python3 package without a verbal readout. The -y switch (echos for yes/assumes yes) allows pkg to be installed without echoing back for a response from the user (In this case, it always asks if you want to download and install dependencies if you don't use the -y switch)

But of course the answer is a yes. We want the package to install all dependencies. So using this -y switch lets it install all dependencies without seeking user intervention.

Next, As @Netware pointed out, super important to change the permissions for the script so it can read, write and execute. (Remember to substitute your directory name where you saved the script as appropriate, mine is Data1)

Code: Select all

chmod 0777 /mnt/Data1/wsdd/wsdd.py
After you run this command, it really isnt needed anymore as the script will keep its permission status, but you can leave it in just because it looks cool.

Finally, To run the wsd script

Code: Select all

/mnt/Data1/wsdd/wsdd.py -w HOME
I left off the -v switch (verbal readout) as I wont be seeing the script run. You can add it back if you would like to see it give a readout when running. I also left off the -i switch for interfaces.
By leaving out the -i switch, this will allow the script to run on all NIC interfaces in your system.

The -w switch is for your Workgroup name. Substitute the name "HOME" with whatever is the name of your Windows Workgroup. Most people never change this name in their Windows OS, and the default name of your workgroup is simply called "WORKGROUP"

Save all three commands under System > Advanced > Command Scripts and you are all done. I tested this to ensure it reinstalled itself after a reboot 3 times. Each time it worked excellently.

I think this can work well until devs implement in Xigma code. Until then, this works wonderfully.

So this is what your setup should look like: (Under System > Advanced > Command Scripts)

Image

Also don't forget to do these notes:

1. Turn off TCP/IP over Netbios under NIC adapter properties (WINS/DNS settings) in Windows OS. This forces Windows to use WSD method instead of Netbios.
2. Turn off SMB1 in Windows, and ensure SMB Direct (Win 10) is enabled. No more worries of security problems under old version SMB.
3. Turn off Local and Domain Master Browser under CIFS/SAMBA service in Xigmanas, as WSD discovery doesn't use old Master Browser anymore. No more [corrupt ;)] Domain Master Browser elections.
4. Once you make all the changes, restart CIFS/SMB service in Xigmanas. Hostnames didn't show up for me until I did this. This is not needed as WSD is super fast. It literally allows the server Hostname to resolve and show up in Windows Network Neighborhood in a few seconds if not, within a second. I am literally blown away by how fast it is. WSD discovery puts old Netbios method to shame. I am literally appalled at the SMB engineers for not including this in SMB before. Its been built into Windows for a long time now. Yes, Netbios worked well before, but WSD method is new discovery method and was built into Windows since dating back to Windows 7! (2008-2009)


Small cosmetics
This is a purely an OCD issue, not a system issue. There is a small cosmetic thing that I realize. Once it runs the script, it won't give the "beep" you're used to hearing after startup of a fully rebooted system. Mind you, this is only if your system utilizes an internal and/or built in speaker/buzzer. The system is still booted up, but since the script is running, you miss the little beep it gives once finished booting. I think this can be fixed with a return or perhaps another "echo back to cd" command, I just haven't figured out yet :)

EDIT: Figured it out: I added an echo "return/redirect command at the end of the initial command to allow it to run the script, then redirect back to the command line internally, then finally, to exit from the "command line space", thus allowing full boot to continue.

This allows Xigma to boot fully, run the script and set you back to the command line, or in this case, the full startup. I can once again hear my trusty old "beep beep beep" the system gives me on full startup.

So modifying only your 3rd postinit command, it should look like this:

Code: Select all

/mnt/Data1/wsdd/wsdd.py -i cxgb0 -4 -w HOME /cd &
Last command is just "exit"

Code: Select all

exit
See Pic Below: (Substitute your Data directory, NIC's and Workgroup name as relevant)

Image

Where the -i switch is my Server NIC interface, Chelsio 10Gb Card (cxgb0) You can leave the -i switch out if you want the script to run on all NIC interfaces in your system
and the -4 switch is to force the script to use IPv4 only (I don't use IPv6 yet)If you use IPv6, then just enter -6 instead.

Ok all done! Full Python3 install with dependencies and script run at bootup! Full hostname resolve under Windows 10 WITHOUT old Netbios and SMB1 protocols. :D

Also when upgrading Embedded installation, save config.xml so in case the commands do not survive upgrade, you can restore as with all other settings, but I think commands should survive firmware upgrades.

Edit 2: Just did an Embedded firmware upgrade from XigmaNAS 11.2.0.4 (6536) to XigmaNAS 11.2.0.4 (6625) and post init commands survive upgrade. Package Python3 quietly installs along with running the script. So all good. :D

Huge thanks to Doktonator again. The postinit idea never occurred to me. :) If not for this, this would not be possible to do.
Last edited by sleyk2010 on 04 Apr 2019 13:44, edited 7 times in total.

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#22

Post by sleyk2010 » 04 Apr 2019 03:32

I also wanted to mention the advantages of this: (In case people wonder what the use of this is)

1. Most people might be comfortable still using Netbios and old SMB1. However, Netbios is old method. Its like VERY old. Like over 30 years old I think. Maybe older.

2, SMB1 is also VERY old. Plus there are security risks with using old SMB1 protocol. Even Microsoft themselves begs people NOT to use it anymore. This is why Windows 10 now comes default SMB1 disabled on fresh install.

3. WSD discovery protocol is new and WAY better. It resolves hostnames like a beast in Windows Network Neighborhood. No more IP address searching, or looking for your server or PC's on your network. It just works, and works fast and extremely well.

4. WSD discovery method has been built into Windows for a while now. You can still use old stinky Netbios method, but why? WSD is literally built into Windows Explorer.

5. Older Netbios discovery protocol is slower than WSD as well. Windows 10 uses SMB direct to better utilize WSD and resolve your Network Neighborhood better than Netbios ever could.

6. Most other popular Server/NAS providers have all upgraded to WSD discovery protocol. Synology has its own implementation built in so their users don't go through the hell of searching for the NAS on their Network. Freenas also implemented this protocol in their software as well. Don't you want to use newer faster method as well?

There are more, but this should suffice people who ask: "Why do I need this?" ;)

doktornotor
Advanced User
Advanced User
Posts: 176
Joined: 16 May 2017 00:22
Status: Offline

Re: New WSD Discovery for Samba Shares

#23

Post by doktornotor » 04 Apr 2019 11:46

sleyk2010 wrote:
04 Apr 2019 00:08
The system is still booted up, but since the script is running, you miss the little beep it gives once finished booting. I think this can be fixed with a return or perhaps another "echo back to cd" command, I just haven't figured out yet :)

EDIT: Figured it out: I added an echo "return/redirect command at the end of the initial command to allow it to run the script, then redirect back to the command line internally, then finally, to exit from the "command line space", thus allowing full boot to continue.

This allows Xigma to boot fully, run the script and set you back to the command line, or in this case, the full startup. I can once again hear my trusty old "beep beep beep" the system gives me on full startup.

So modifying only your 3rd postinit command, it should look like this:

Code: Select all

/mnt/Data1/wsdd/wsdd.py -i cxgb0 -4 -w HOME /cd & exit
Dunno, I've already posted a pretty clean method to daemonize and supervise the WSD service here.

:?

sleyk2010
Starter
Starter
Posts: 17
Joined: 22 Nov 2018 03:30
Status: Offline

Re: New WSD Discovery for Samba Shares

#24

Post by sleyk2010 » 04 Apr 2019 14:00

Hey Doktornator, I saw the daemon method but I couldnt figure it out :cry:

The post init method is actually pretty good and simple for me.

I went into length in my above posts so that I could explain in detail what each part does as I think it helps people understand a bit better if they're new to reading this.

But its really just 4 simple commands saved under Command Scripts:

1. pkg install -q -y python3
2. chmod 0777 /mnt/Data/wsdd/wsdd.py
3. /mnt/Data/wsdd/wsdd.py -i nicxxx -4 -w name_of_workgroup/cd &
4. exit

Then when you reboot, it works beautifully.

But the daemon method works too for those who prefer :D
Actually, when you have time, can you please explain abit better how to use the daemon method? It would be good to know how to utilize both if needed. Also I like the idea of supervising the script. Does this mean it will create logs for viewing?

Either way I'm very happy. Thanks again to you for your help with this!

doktornotor
Advanced User
Advanced User
Posts: 176
Joined: 16 May 2017 00:22
Status: Offline

Re: New WSD Discovery for Samba Shares

#25

Post by doktornotor » 04 Apr 2019 14:14

There's nothing to figure out really. You use that as the post-init command. Adjust the part after -S to your needs and script location - e.g.

Code: Select all

/usr/sbin/daemon -u daemon -r -p /var/run/wsdd.pid -P /var/run/wsdd_daemon.pid -S /mnt/Data/wsdd/wsdd.py -i nicxxx -4 -w name_of_workgroup
This will run the script in background as low-privs user (daemon) and re-spawn it if it gets kills by something.

P.S. Also, the script should NOT be world-writable (definitely not in a place that's a data share accessible by others) - use 755, not 777.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4833
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: New WSD Discovery for Samba Shares

#26

Post by raulfg3 » 04 Apr 2019 19:44

Please developers, try to include on next revision, it's really a good addition.
12.0.0.4 - BETA (revision 6625)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes
Old Wiki

User avatar
Snufkin
Advanced User
Advanced User
Posts: 279
Joined: 01 Jul 2012 11:27
Location: Etc/GMT-3 (BSD style)
Status: Offline

Re: New WSD Discovery for Samba Shares

#27

Post by Snufkin » 06 Apr 2019 18:50

I would like to add some thoughts to the discussion.

SMB Direct
This feature has nothing to do with disabling SMBv1 and enabling WS-Discovery protocol, ref article SMB Direct.

WSD protocol
Microsoft doesn't recommend activating WS-DISCOVERY protocol, ref article SMBv1 is not installed by default.
Note We recommend that you map drives and printers instead of enabling this feature, which still requires searching and browsing for their devices.
Zero-configuration networking
I would suggest paying attention to the Zero-configuration networking concept.
Linux, MacOS and MS Windows have their own implementation of the concept, but they all touch at two points Linux
Avahi is a free zero-configuration networking (zeroconf) implementation, including a system for multicast DNS/DNS-SD service discovery.
MacOS
Bonjour is Apple's implementation of zero-configuration networking (zeroconf), a group of technologies that includes service discovery, address assignment, and hostname resolution.
FreeBSD (XigmaNAS)
Zeroconf/Bonjour service is already implemented in the system. By default, XigmaNAS will announce this available service (multicast) with the Zeroconf protocol.
MS Windows
Builtin mDNS/DNS-SD (ZeroConf) support in Windows 10 has only been added to the modern APIs and not available in Win32. One can install a third-party mDNS resolver such as Bonjour for Windows to enable support in Win32.
As you can see, most of the difficulties arise with MS Windows. Therefore I suggest not to touch FreeBSD, Linux, MacOS but to fix Windows a little bit.
XNAS 11.2.0.4 embedded, ASUS P5B-E, Intel DC E6600, 4 GB DDR2, 2 x HGST HDN726040ALE614, 2 x WDC WD5000AAKS, Ippon Back Power Pro 400

doktornotor
Advanced User
Advanced User
Posts: 176
Joined: 16 May 2017 00:22
Status: Offline

Re: New WSD Discovery for Samba Shares

#28

Post by doktornotor » 06 Apr 2019 22:07

Snufkin wrote:
06 Apr 2019 18:50
As you can see, most of the difficulties arise with MS Windows. Therefore I suggest not to touch FreeBSD, Linux, MacOS but to fix Windows a little bit.
This touches nothing in the *nix department. There's really no replacement for WS Discovery in Windows. The mDNS/Zeroconf is completely non-fuctional and useless there. "Added to the modern APIs " -> non-existent; noone wants to use any of that failed tiles junk. Finally, "we recommend that you map drives" is another piece of useless MS suggestion. When you already know where the shared stuff is, you don't need any Bonjour or whatever, there's been no issue with things like \\fileserver.example.net\myshare when you have local DNS working. This is a replacement for the NetBIOS network browsing, has nothing to do with mapping drives. Sigh.

Shperrung
experienced User
experienced User
Posts: 85
Joined: 04 Apr 2018 16:29
Status: Offline

Re: New WSD Discovery for Samba Shares

#29

Post by Shperrung » 09 Apr 2019 10:56

Something wrong with WSDD or my installation. python3 says that there is no file/directory.
pkg install python3 was made before.
Permissions 0755 were done.
Xigmanas embedded.

Code: Select all

Last login: Tue Apr  9 09:47:05 2019 from 10.8.0.6
Welcome to XigmaNAS!
xigmanas: ~# pkg install python3
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent version of packages are already installed
xigmanas: ~# /mnt/RAID/scripts/wsdd-0.3/src/wsdd.py -i nicre0 -4 -w WORKGROUP/cd &
[1] 74757
xigmanas: ~# env: python3: No such file or directory
11.2.0.4 - Omnius (revision 6177)
ASRock J3710-ITX, LAN: Realtek RTL8111GR; 16Gb RAM; WD 1Tbx2, WD 2Tb; UPS Powercom WOW500U.

netware5
experienced User
experienced User
Posts: 93
Joined: 31 Jan 2017 21:39
Location: Sofia, BULGARIA
Status: Offline

Re: New WSD Discovery for Samba Shares

#30

Post by netware5 » 09 Apr 2019 11:14

That's strange ... I see in your signature that your XigmaNAS version is 6177, so maybe this is an issue? I confirm that it is working on versions 6400 and 6625
XigmaNAS 11.2.0.4 - Omnius (rev.6625) embedded on HP Proliant Microserver Gen8, Xeon E3-1265L, 16 GB ECC, 2x4TB WD Red ZFS Mirror

Post Reply

Return to “Suggestions & Requests”