pnethood - samba share mounter

Stuff that has yet to be sorted into a category.
Message
Author
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]

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

#36 Post by disciple »

Sounds great :)
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.
That would be a good way of doing it, although I still think it is silly to mount SAMBA shares inside /$HOME by default, particularly when Puppy is generally a single user system. If, for example, the average Puppy user runs a file search in /root, they won't generally be wanting to search mounted network shares...

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

#37 Post by Béèm »

Hi,

You might remember that I have the 'special' case of having two connections, the WiFi one and the 10.0.0.10 one.
Specifying

Code: Select all

pnethood md8818, 10.0.0.10
only gives me the md8818 one,.
BUT,
specifying

Code: Select all

pnethood 10.0.0.10, md8818
gives me the two tabs.
hmmm.
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

#38 Post by HairyWill »

@Beem
Don't put any spaces in, there may also be a bug in the parameter parsing. I would expect to see both appear either way and it shouldn't cause a problem, though I'm not sure what happens if you start trying to move/copy stuff from inside one mountpoint location to somewhere else inside the other. I would hope that the connection would terminate or lockup to avoid you doing this. I don't fancy experimenting, I'm sure its been considered by the samba team and you can't end up in this situation without deliberately telling pnethood to open two tabs for the same server.

You should be able to do
pnethood 10.0.0.10,192.168.1.2,MD8818
and get three tabs. I presume that the first two will guarantee to use the firewire and wireless nics respectively and the third one will use whatever the netbios name resolves to. I think we've established that it always points to the 192.168..... network in your case.

@tout de le monde
I tried installing pnethood on Debian Lenny the other day. I had to make a couple of minor edits including installing cifs support for mounting. I ran it as root and it worked fine. I didn't try as a normal user.

This adds another item to the todo
cifs support
Does anyone out there use cifs in puppy?
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]

black
Posts: 14
Joined: Sat 11 Aug 2007, 02:29

cifs

#39 Post by black »

Hey HW,

Been toying with "pnethood" 0.41 for several days and it's a neat little app. Running well in both puppy, kanotix, and cpx. Would like to see it with "cifs" support, as I('ve been a user for several years) and prolly others prefer it. Connections seem faster, file xfers are much faster on my 'machines...CIFS PLEASE!

55

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

#40 Post by HairyWill »

I've just had a look and mount.cifs seems to be in my puppy though it isn't in pup_300.sfs I don't remember putting it there. I'll investigate further some time this week.
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

#41 Post by Béèm »

@HairyWill,
Sorry for the confusion.
Indeed with the comma separating the two, even either way, I get the two tabs. Nice

about cifs:
Is this a follow-on of Sun's nfs?
Is cifs an industry agreed one or a proprietary one?
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

#42 Post by HairyWill »

Common Internet File System, becoming preferred over smbfs
http://linux-cifs.samba.org/

my initial research

I think it needs cifs.ko or to be already compiled into the kernel, beyond my experience.

Servers are identified by IP address or by tcp host name. Not by netBIOS name.

mount.cifs is needed to resolve hostnames.

Currently smbmount in puppy is over 800k if the cifs module is considerably smaller this might be an incentive for Barry to consider it as an alternative. This might also be a way to remove the need for nmblookup another 600+k. This is speculative, I do not have sufficient understanding to recommend that this is doable and I have no idea of the implications for samba printing.
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

#43 Post by Béèm »

With the .41 I could mount my windows share through the 10.0.0.10 (1394) interface.
I just tried the .5 in muppy008 now.
When scanning on 10.0.0.10 no shares are found.
If I scan on the WiFi (192.168.1.2) interface pnethood finds them.

Any idea why?
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

#44 Post by HairyWill »

Do you know for certain that the firewire interface is active in muppy 8?
What do you get for
smbclient -N -L 10.0.0.10
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]

deceptika
Posts: 3
Joined: Sun 02 Dec 2007, 16:56

#45 Post by deceptika »

HairyWill wrote:Common Internet File System, becoming preferred over smbfs
http://linux-cifs.samba.org/

my initial research

I think it needs cifs.ko or to be already compiled into the kernel, beyond my experience.

Servers are identified by IP address or by tcp host name. Not by netBIOS name.

mount.cifs is needed to resolve hostnames.

Currently smbmount in puppy is over 800k if the cifs module is considerably smaller this might be an incentive for Barry to consider it as an alternative. This might also be a way to remove the need for nmblookup another 600+k. This is speculative, I do not have sufficient understanding to recommend that this is doable and I have no idea of the implications for samba printing.
no need for that, do just like Windows of any flavor does, they rely on LM hosts to resolve canonical \\MACHINE or \\IPC$ name through the somewhat primitive netBIOS protocol, first by touching {IPC$} name and then matching/touching IP# (underscore is forbidden in NT(IPC$) naming) which means use your hosts...in etc/

nice job! good luck
8)

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

#46 Post by HairyWill »

deceptika wrote:no need for that, do just like Windows of any flavor does, they rely on LM hosts to resolve canonical \\MACHINE or \\IPC$ name through the somewhat primitive netBIOS protocol, first by touching {IPC$} name and then matching/touching IP# (underscore is forbidden in NT(IPC$) naming) which means use your hosts...in etc/
Thanks Deceptica, I think I understand what you are saying and if you are able to post an example it would make things clearer. I assume you mean something like

Code: Select all

touch //KANGAROO
I thought touch was just for files. AFAIK nothing in puppy actually maintains /etc/hosts, are you suggesting that users enter the addresses into it themselves.

I'm not entirely sure where netBIOS names get resolved. But I have established that nmblookup isn't needed by pnethood. If nmblookup is needed for printing it might be possible to hack a small script to replace it based on nbtscan or something using /etc/hosts (though I don't fully understand what you are saying and wonder if it suffers from a bootstrap problem).

I have noticed that the completeness of nbtscan does depend on the scan time. At work a 1 second wait gets me 100 ish servers 20 seconds gets me over 600. The difference is probably not important for a small home network. I might have to put a slider in for the user to control 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

#47 Post by Béèm »

HairyWill wrote:Do you know for certain that the firewire interface is active in muppy 8?
What do you get for
smbclient -N -L 10.0.0.10
There was a proble loading the modules ohci1394, ieee1394 and eth1394
Once solved and an IP attributed to the FireWire port it worked.
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]

deceptika
Posts: 3
Joined: Sun 02 Dec 2007, 16:56

#48 Post by deceptika »

HairyWill wrote:
deceptika wrote:no need for that, do just like Windows of any flavor does, they rely on LM hosts to resolve canonical \\MACHINE or \\IPC$ name through the somewhat primitive netBIOS protocol, first by touching {IPC$} name and then matching/touching IP# (underscore is forbidden in NT(IPC$) naming) which means use your hosts...in etc/
Thanks Deceptica, I think I understand what you are saying and if you are able to post an example it would make things clearer. I assume you mean something like

Code: Select all

touch //KANGAROO
I thought touch was just for files. AFAIK nothing in puppy actually maintains /etc/hosts, are you suggesting that users enter the addresses into it themselves.

I'm not entirely sure where netBIOS names get resolved. But I have established that nmblookup isn't needed by pnethood. If nmblookup is needed for printing it might be possible to hack a small script to replace it based on nbtscan or something using /etc/hosts (though I don't fully understand what you are saying and wonder if it suffers from a bootstrap problem).

I have noticed that the completeness of nbtscan does depend on the scan time. At work a 1 second wait gets me 100 ish servers 20 seconds gets me over 600. The difference is probably not important for a small home network. I might have to put a slider in for the user to control it.
HairyWill;

I did not realize before, for printing in windows any flavor:
SMB protocol must be installed and running, ctl panel, network settings add protocol.
If SMB isn't installed you will never be able to print from linux/unix and if you do it should be regarded as mere chance.


I'm not entirely sure where netBIOS names get resolved.
They get resolved from the WIN registry, there are several keys, one of them is
HKCU/HKLM/windows/current version/WINDOWSNT/currentcontrolset..00--01 etc. entries are listed under hosts, LMHOST, domain.

If there are hosts available for discovery win will look in here first if not available ie: key has null value, windows will go to LMHOSTS file and finally will resort to the less human HOSTS inside of :\%WINPATH%\system32\drivers\etc, any host maybe added, for linux/ any flavor a valid HOST entry will suffice and speed things up,
format: 192.168.21.10 (4 spaces) HOST name.

One of the biggest hurdles in NT/linux networking is resolving host names,
which comes down to the same for both NT and linux: DNS, in address arpa, canonical name, etc, etc which is the reason why win uses winserver and their limited DNS server, but in any event
DNS applies to both INTRA and EXTRA net names, and every DNS server in the world relies on a properly prepared HOST file, as an example debianXdemoen DNS uses it and will die if left blank or go into spams, same goes for windows DNS, Ntcanuck, kerio's DNS and any DNS
you mention will heavily rely on this file.

I run a small SQL farm and there is just no humanly possible way to implement one of the best guarded secrets of the trade: round bobbin' without a hosts entry. get it?

are you suggesting that users enter the addresses into it themselves.?
that wouln't hurt now would it?, open leafpad and start editing...
this will solve 90% of network issues, and yes linux resolves DNS issues
from this file too. can you imagine what the internet 'd be like without
a hosts file? (the internet equivalent is a ZONE file)

if you have more then 2 NICs then switch the network ID (subnet) to avoid having more then then 2 totally differently segmented IP NETWORKS, IE:

nic 1 192.168.SUBNETID.MACID
nic 2 10.10.10.1 ---NOT GOOD
this is ok (if you have a DNS/WINS server running, but in the case of mini networks, smaller then 30 pieces where there is no maintainable DNS will not work) but will rather send any network app into oblivion
looking at 2 different networks for NAME resolution, when neither network's main PDC has a valid hosts entry in it (if no server then localhost applies to:)

take care now!

8)

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

#49 Post by Béèm »

This is my config
MD8818-192.168.1.2---WiFi---192.168.1.2-Modem/router
R40-192.168.1.3------WiFi---192.168.1.2-Modem/router
R40-10.0.0.10--------1394-----10.0.0.11-MD8818
When I start pnethood, I only get MD8818 on the WiFi connection and shares can be mounted.
When I want to do it for 1394 connection I issue pnethood 10.0.0.10
I can have both by issuing pnethood MD8818,10.0.0.10

I have been looking in XP if I could 'assign" a host name to the 10.0.0.10 one other then MD8818, but didn't find it.

Well it's not a big deal as both cases 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]

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

Menu entry from .pet

#50 Post by disciple »

The .pet does not give me a menu entry, although I guess it might work in more recent Puppies.
I think the desktop file should go where everything else puts menu entries - in /usr/share/applications, not /usr/local/share/applications.

EDIT - no, it still didn't work. I actually had to change the Categories to Network;Utility



I've also attached the help file with a few typos corrected :)

EDIT - wait a minute - I saw some more typos - I'll give it a proper check and be back in a couple of minutes.
Attachments
pnethood.html.gz
(3.32 KiB) Downloaded 457 times
Last edited by disciple on Sat 12 Jan 2008, 00:21, edited 1 time in total.

Post Reply