pnethood - samba share mounter

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#16 Post by HairyWill »

@disciple
aaarrrrggghhh
spaces in netbios names, a good reason to rely on ip addresses
That is going to need some work, at the moment it uses the names to create variables. If anyone knows of a character that is valid in a bash variable but not valid as a netbios name your input would be appreciated. Otherwise I will have to replace spaces with underscores and escape existing underscores with an extra underscore. That's doable.

@davec51
I'd like to help and appreciate the report but need some information
What errors do you get if you run
pnethood
from the console?
What is in /tmp/pnethood-log?
There should be some XML in /tmp/pnethood-gui, posting that might be helpful? The command
ifconfig
should help you find your IP address.
if you replace the last two numbers with zeros and keep the first two as the x.x as below what do you get for
nbtscan x.x.0.0/16
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#17 Post by disciple »

Oh yeah. BTW I was on "Green Room" trying to connect to "Toms" - you know the code, so I guess you'll probably know whether that space is the problem. I imagine it would be a problem if I was trying to connect to a computer with a space in it...
Are you sure you can't just get it working with the right use of quotes, rather than character substitution?
Also, I noticed a while back that if I don't check the option in LinNeighborhood to replace spaces with underscores (I think it does it for netbios names and sharenames), then it still mounted shares OK, but unmounting failed. That was REALLY BAD, and I can't remember if I decided LinNeighborhood or smbunmount was at fault.

I just now tried connecting to Toms from a relatively fresh install of 2.16, (which doesn't have Samba server setup and doesn't identify itself as Green Room) and it works fine, so it's not the network protocols or anything like that. My parents keep trying to keep me off the computer, but I'll try and confirm tomorrow if it's that space, or something else about my system (maybe age or something I've done to it...)

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#18 Post by HairyWill »

thanks disciple I'm getting some useful background from your reports

I hadn't considered that it would also pickup the local samba server. This shouldn't be a problem generally (or for you once the spaces issue is resolved).

My problem with spaces is because I use server names to construct variable names inside the gtkdialog code and also because I have a shell variable containing all the server names. I'm going to work on this Thursday night.

If you think parents get in the way of your 24-7 computing involvement, you should try getting a wife and children. YMMV
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#19 Post by HairyWill »

Now at version 0.4
0.3 was downloaded 36 times

new features
# inbuilt limit of 10 servers scanned, once this limit is exceeded you get a list of all servers and are asked to choose one.
# server and share names with spaces, dots and hyphens should work (only partially tested, may cause name collisions ie: my-server and my_server)
# servers may be specified by IP address
# scan includes every network interface, except ppp ones. I can't see why you would want to scan a ppp interface, it was taking ages and taking down my pptp vpn connection
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#20 Post by Béèm »

Hi HairyWill,

Remember my set up with a WiFi and a 1394 connection.
I get the tab with the PC on which the shares are.
The shares are displayed, but connection to it don't work if I click on one of them. Apparently the corresponding directory in /root/pnethood/.... isn't found.

When I look in info I see:

Code: Select all

scanning network
Scan: 192.168.0.0/16 10.0.0.0/16
probing MD8818
The 10.0.0.0/16 seems ok as my two PC's are on 10.0.0.10 and 10.0.0.11
But 192.168.0.0/16 isn't correct as my PC's are on 192.168.1.2 and 192.168.1.3

It's a pity, the GUI looks nice.

I disabled the WiFi connection to try only the 1394 one, but same result.
Pnethood keeps scanning I think.

I am not sure what I have to enter in userid and password.
In LinNeighborhood I scanned the machine with user root without password.
I tried also to no avail.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#21 Post by HairyWill »

Beem,
thanks for the feedback
I've uploaded a new version 0.41 as 0.40 had a bug (apologies to the 6 or so people that downloaded it). I initialised PROGPATH on line 18 of pnethood with my test directory not the install directory. I'm amazed it worked at all.

The subnets it scanned look correct to me. 192.168.0.0/16 scans everything starting with 192.168

Try starting pnethood from the command line as there is more debugging info output there.

Code: Select all

pnethood
and if that fails

Code: Select all

pnethood MD8818
the output from

Code: Select all

smbclient -N -L MD8818
might be helpful
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#22 Post by Béèm »

You sure keep us busy. :wink:

I have good, bad and good news.
Good news:
I can connect with MD8818 in the tab.

Bad news:
Did put the WiFi down.
No connection possible.
The shares on the MD8818 not connectible via 10.0.0.10

Good news:
started with pnethood 10.0.0.10
Could connect to the shares via the 1394 interface.

So the scanning stops when the MD8818 is found on 192.168.1.2 and doesn't continue to look for the 10.0.0.10 anymore.

But I am happy as it is now.
I can easily create a symlink to start pnethood 10.0.0.10

Thanks for the little program and keep up the good work.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#23 Post by HairyWill »

Beem,
I'm glad its sort of working for you. I'm not sure that it is ever going to work using names. As I recall it didn't work in linneighborhood either.

I am not entirely sure how netbios names get mapped to ip addresses. I think your results demonstrate that for you the netbios name MD8818 is mapped to the ip address 192.168.1.2 or 3. My assumption is that the name can't be mapped to two ip addresses and the protocol doesn't support rescanning / initialising / dynamic routing or something similar if there is no route to the IP
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#24 Post by Béèm »

Will,
As you asked for the smbclient output, here it is.

Code: Select all

# smbclient -N -L MD8818
Domain=[MD8818] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       Externe IPC
        D$              Disk      Standaard-share
        print$          Disk      Printerstuurprogramma's
        I$              Disk      Standaard-share
        RX600           Printer   EPSON Stylus Photo RX600
        G$              Disk      Standaard-share
        Synchro_data_disk Disk      
        ADMIN$          Disk      Beheer op afstand
        H$              Disk      Standaard-share
        C$              Disk      Standaard-share
        S$              Disk      Standaard-share
        L$              Disk      Standaard-share
        Data-G          Disk      
Domain=[MD8818] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
# smbclient -N -L 10.0.0.10
Domain=[MD8818] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       Externe IPC
        D$              Disk      Standaard-share
        print$          Disk      Printerstuurprogramma's
        I$              Disk      Standaard-share
        RX600           Printer   EPSON Stylus Photo RX600
        G$              Disk      Standaard-share
        Synchro_data_disk Disk      
        ADMIN$          Disk      Beheer op afstand
        H$              Disk      Standaard-share
        C$              Disk      Standaard-share
        S$              Disk      Standaard-share
        L$              Disk      Standaard-share
        Data-G          Disk      
session request to 10.0.0.10 failed (Called name not present)
session request to 10 failed (Called name not present)
Domain=[MD8818] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
# 
So there is a difference with the 10.0.0.10 which indicates session request failed.
But indeed it may have to do with names.
Maybe somtehing has to be done on the XP side.

Those network issues are still some mystery for me.

But I know now how to get my 1394 connection. :D

Bernard
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#25 Post by Béèm »

Just for fun I made a little exercise.
I used the KDE.3.5.7 sfs and started KDE.
In a console I typed pnethood 10.0.0.10
I got the share mounted and show brings up ROX and the contents.
But Konqueror doesn't see the mount, funny.

Well nothing to do with Pnethood.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#26 Post by HairyWill »

I've noticed that linneighborhood lists any samba mounts so it recognises mounts made by pnethood and can be used to unmount them.

Do you mean that it can not navigate to /root/pnethood/10_0_0_10/share? Or do you mean that it doesn't automatically recognise that there is an active samba mount? The last time I used Konqueror was about three years ago I have no idea where it would expect samba shares to be mounted.

I've just realised another usage scenario.
If I use pnethood to mount a share on my network of 100 servers and close down pnethood then I have to remember the name of the server to be able to start pnethood with the right server name to be shown the right button to unmount it.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#27 Post by Béèm »

HairyWill wrote:I've noticed that linneighborhood lists any samba mounts so it recognises mounts made by pnethood and can be used to unmount them.
Nice to know.
HairyWill wrote: Do you mean that it can not navigate to /root/pnethood/10_0_0_10/share? Or do you mean that it doesn't automatically recognise that there is an active samba mount? The last time I used Konqueror was about three years ago I have no idea where it would expect samba shares to be mounted.
No it finds the files alright via /root/pnethood/..... when I browse to it, but I expected to see it in the /media: place as the other resources like hda1 and hda2. Maybe I am wrong in thinking this. Also I haven't figured out how to use the network places in Konqueror. Maybe it's in there.
HairyWill wrote:I've just realised another usage scenario.
If I use pnethood to mount a share on my network of 100 servers and close down pnethood then I have to remember the name of the server to be able to start pnethood with the right server name to be shown the right button to unmount it.
So in other words when pnethood is restarted without argument it should display as many tabs as there are servers with mounted resources? That would sure be cool.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#28 Post by HairyWill »

I've uploaded a bugfix 0.42 this only affects users with more than 10 servers and is literally a one character fix line 62 of /usr/local/pnethood/pnethood needs gtkdialog changed to gtkdialog3
Béèm wrote:No it finds the files alright via /root/pnethood/..... when I browse to it, but I expected to see it in the /media: place as the other resources like hda1 and hda2. Maybe I am wrong in thinking this. Also I haven't figured out how to use the network places in Konqueror. Maybe it's in there.
I wasn't really sure where I should put the mountpoint. I don't have that much experience of other distros, kde or gnome. I elected for inside the users home directory as it seemed simplest from a security perspective if it ever gets used in a multi-user situation.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#29 Post by Béèm »

Don't bother too much.
I just realize that hda1, hda2 are system devices (/dev/hda1 etc..) while the Windows share is a lan resource. Probably not quite the same.
Therefore not found in KDE's storage media (media:/) I think.
I will probably have to look in network folders (remote:/) and indeed I find an entry Samba Shares, but something isn't going well. A problem in KDE.

So the choice of yoyr mount point is ok and I can mount with pnethood and browse to that mount point.

Conclusion not really a problem.

One suggestion tho.
On the show button ROX is attached as default.
It would be nice to make it configurable by the user.
So in my case if I could attach Konqueror to the button, it would be nice.
Others might configure another file browser.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#30 Post by disciple »

Code: Select all

I've just realised another usage scenario. 
That is a very important one: :)

A workaround would be to start pnethood with alltray (will be in Dingo, but compiles fine in any Puppy). Alltray puts a program in the tray, and makes the close button just act like minimize.
I start MUT with alltray when Puppy boots, as otherwise I'll end up closing it, and it takes a while to start again. I have alltray set as sticky, and ignored by the JWM task list too.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#31 Post by HairyWill »

@Beem
I have avoided giving the user any choices so far and don't really want to start. I could implement a .pnethood file in home or I could assign the filemanager in a variable at the top of the code. I should add some checks for dependencies when it starts as well. smbclient, smbmount, nbtscan, rox, rxvt.
If you want to fix the file manager for yourself these are the two lines you need to edit, I suppose the first one should be defaultbrowser / defaultbarehtmlviewer or maybe just "man pnethood"

Code: Select all

# grep -n rox usr/local/pnethood/pnethood 
107:    <action>rox /usr/share/doc/pnethood.html</action>
186:    <action>rox "${MOUNTPOINT}"</action>
# 
@disciple
Barry is squeezing in alltray, interesting. I'm not sure about the minimising to tray.

The scenario I have in mind includes being able to manage several servers. I think I will just have to check mount on startup and add any servers listed to the list of tabs.

I presume "GREEN ROOM" works for you.

Do either of you have an opinion on whether the mountpoints should be in a hidden directory.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#32 Post by Béèm »

HairyWill,

Thank you for the tip on the filemanager.
But I have no problem to leave it as is.
Maybe when given too much choice people could get confused indeed.

In the Puppy system, no mounting point is hidden.
So maybe it's better to leave it as is.
Some people could try to find the mounting point and not thinking it could be a hidden point.

Bernard
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#33 Post by disciple »

Barry is squeezing in alltray, interesting.
Alltray is tiny if you remember to strip it (and huge otherwise :) )

I think you can also tell alltray not to put something in the tray, so you could run pnethood with alltray, but in the taskbar. (then you wouldn't have to make it sticky, which things in the tray need to be, otherwise they do strange things when you click on them from a different desktop from the one they were started on).
I think it is much more user-friendly (particularly for new and-non technical users) if mounting and unmounting programs can't be easily closed by accident, especially if they are programs that can take a long time to do a scan on startup.

You're approach of scanning for mounts is more "proper" though :)
I presume "GREEN ROOM" works for you
Sorry, I'll probably check that on the weekend if not before. I haven't used Puppy this week as my parents are keeping me off the computer :(
Do either of you have an opinion on whether the mountpoints should be in a hidden directory.
I seem to remember that clicking "unmount" in ROX for a SAMBA mount did something really bad, but maybe that was just with the older rox and with mount points with spaces or something. If there is a problem like this then I think they should be hidden, otherwise definitely not.
BTW I personally like to put SAMBA mount points in /mnt/network :) It seems to make much more sense than somewhere in /root

regarding a configuration file, I think it would be cool to have a basic configuration file, to specify filemanager and maybe things like a default server(s) to scan, or shares to mount automatically.
If you didn't feel like this it would still be good to just initialise a filemanager variable at the start of the script, so people could change one line to get it to work with something else.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#34 Post by disciple »

0.42 still identifies itself as 0.41 :)

Yes - it does work great with spaces in domain and server and share names, and without passwords, although you are obviously right about the possible name conflicts.
It seems to scan much faster now :)

Good work Will.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#35 Post by HairyWill »

version 0.5 released
Some bug fixes by dougal he has also converted it to a roxapp, I've done a fair bit of work since so any new bugs are mine!.
I've removed the use of gxmessage and yaf-splash for errors and progess information. All of this is now handled by gtkdialog, this reduces dependencies and also means that all windows match the gtk theme.
Added a FILER variable at the start, this makes it easier to edit the code and specify a different one.
added a quit button (this also makes the GUI big enough to show the refresh message when no shares are reported).
removed the horrible while loops iterating over the arrays this is now done properly using for
help page is now launched using the man command
introduced a check for a server named <unknown> which appears on my network at work sometimes (the sometimes bit made debugging especially interesting). I don't believe this is a valid netBIOS name and it was crashing gtkdialog (unsurprisingly), so I've just deleted the server from the list.
tabs are always shown for servers with shares that are currently mounted (you can't loose track of the machines with mounted shares on a big network)
status, error handling and reporting improved a bit (can't really be improved much without further user feedback)

If you are upgrading an older release
Conversion to a roxapp, means the main file location has moved to /usr/local/apps/pnethood
In dingo Barry has moved nbtscan and the pnethood launcher from /root/my-applications/bin to /usr/sbin so I have copied this (otherwise upgrading would fail)
This all means upgrading may leave a few old files on your system but they shouldn't cause a problem, unless you have mucked about with the order of locations in your PATH variable.

Still To Do
* Allow user with more than 10 machines to select a new one without rescanning the entire network
* Allow user with more than 10 machines to select several
* Handle servers with lots of shares. This will probably mean changing the interface implementation to use gtkdialog tree instead of buttons. This is a shame because I like the buttons.
* replace nbtscan with a scan that works with netbios over tcp/ip, this will probably just be a backup in case nbtscan produces nothing
* there are a number of situations where grep, sed and tr are used to generate values with no input checking it would be a good idea to generate regular expressions that could be used to check that there output was correct, this would have trapped the <unknown> server error or a least displayed a warning.
I think I've hit the 80/20 barrier so I'm not committing to actually doing these unless some says they actually need them.

Downloads were at 83 before I uploaded the new version.

disciple
Thanks for the feedback, glad it works. The startup time is mainly determined by how long it takes a server to respond tosmbclient -N -L servername my single home server seems to vary widely between 1 and 10 seconds to reply, I have no idea what causes the discrepancy.
I had never tried using ROX right-click to unmount before, it seems to work OK for me.
I used /$HOME/pnethood for the mountpoints because it matched linneighborhood and it mounted the users shares inside their own space. Maybe I should make this specified by a variable at the start as well.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

Post Reply