Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 21:15
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
pnethood - samba share mounter
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 6 of 20 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, ..., 18, 19, 20 Next
Author Message
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Thu 03 Apr 2008, 23:08    Post_subject:  

Code:
share=G, mountpoint=/mnt/network/GREEN_ROOM/G
share=E, mountpoint=/mnt/network/GREEN_ROOM/E
share=PRINTER$, mountpoint=/mnt/network/GREEN_ROOM/PRINTER$
finished probing GREEN ROOM

started probing GREEN_ROOM
GREEN_ROOM reports no shares, trying again with password
GREEN_ROOM still reports no shares, checking mount in case all shares are mounted already
share=E, mountpoint=/mnt/network/GREEN_ROOM/E
finished probing GREEN_ROOM


On second thoughts, this makes it look like it might be fairly easy - if it fails to find a server with an underscore, it could try looking for the same server with a space, and if it fails to find a share with an underscore, it could try looking for the same share with a space.
Or maybe it is best just to not substitute underscores for spaces Smile I can't remember if anyone mentioned a reason we NEED to do this.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Fri 04 Apr 2008, 05:14    Post_subject:  

The replacing of spaces with underscores was always an imperfect hack.
This particular bug doesn't affect sharenames, I've just checked. As part of the move toward cifs I am replacing netbios names with ip addresses (though names will still be what is displayed). This should solve this bug.

As to remembering the last status I initially thought it was a good idea but can for see a number of potential problems. This would involve having lots of state checking throughout the program to ensure that the network status really is as expected.

The cost of finding servers is fixed, nbtscan uses a timeout parameter.
The cost of scanning each client is determined by the server response to smbclient -L, this seems to vary widely. With 3 windows machines on the network one of which has shares my startup time is about 10 seconds. In the extreme case with 9 servers startup time could be as much as 90 seconds (I agree this isn't good). If I had a network with 9 servers I would probably start pnethood from the prompt and specify the servername I wanted to use.

How about this.
Every time you use a mount button the servername (or should it be ip) gets written to a previousserverlist. When you first start pnethood it only calls smbclient -L on the servers in this list and then clears the list. If this fails to return anything it automatically does a full scan. If you hit the refresh button it does a fullscan.

You still bear the cost of calling smclient -L on each machine you want to access and if you do hit the refresh button you will have payed that cost twice for the machines in the previousserverlist.

I feel strongly that it is not safe to try and access shares on a server with calling smbclient -L on it first, I'm not keen on making assumptions about the state of the network.

I did think about an automount feature that would allow you to put a check next to shares that you wanted mounted next time pnethood was started. You could even then have pnethood auto start at boot and mount the shares. By the time you want this level of sophistication you are probably better off putting your own mount commands into rc.local (though of course you can no longer guarantee that the network is up when rc.local starts). Of course all this stuff leads to options and choices which may be confusing for the newbie. Where this project started was trying to simplify a complicated application. I don't want to lose sight of that.

I don't think the stuff discussed here will make into the next version. I am focussed on optional password saving, optional cifs mounting and user specified rescan time.

cheers for the suggestions

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Fri 04 Apr 2008, 05:39    Post_subject:  

disciple wrote:
Or maybe it is best just to not substitute underscores for spaces Smile I can't remember if anyone mentioned a reason we NEED to do this.
It was because I generated gtkdialog accessible variable names from the server and share names.
_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Fri 04 Apr 2008, 17:55    Post_subject:  

Ah, yes. That all makes a lot of sense.
Quote:
How about this.
Every time you use a mount button the servername (or should it be ip) gets written to a previousserverlist. When you first start pnethood it only calls smbclient -L on the servers in this list and then clears the list. If this fails to return anything it automatically does a full scan. If you hit the refresh button it does a fullscan.

You still bear the cost of calling smclient -L on each machine you want to access and if you do hit the refresh button you will have payed that cost twice for the machines in the previousserverlist.
No, I wouldn't really find that helpful, although I can see how it could be helpful to some people. But I think it would confuse people if it was the default behaviour.

But I'd be interested in whether it really is dangerous trying to access shares that aren't available. Considering the number of people that mount samba shares in boot scripts, I would have thought that any problems would be ironed out by now, or there would be some very unhappy people looking for fixes. And what if, for example, I just leave pnethood open because I am tired of all the scanning, and I need to mount and unmount different shares every now and then? Then if someone shuts down one of the servers, and I try to access it, we would have the same situation anyway.
I think you are probably right, and it would be best to always scan as the default behaviour, but I still think it would be very useful to have an option to load the previous list. Even if we have to scan once every time we boot puppy.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Fri 04 Apr 2008, 21:36    Post_subject:  

One thing about replacing netbios names with IP addresses is that someone will need to know the IP address if they have shares mounted from several servers and want to navigate to a mounted share without opening pnethood again.
I guess that's another advantage of having a quick start option that uses previous list.

Wow - I just noticed that not only is the pnethood scan nice and quick if all my servers are running linux instead of Windows, but it mounts Linux shares almost instantly as well... must be time to get rid of Windows Smile

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Tue 08 Apr 2008, 09:56    Post_subject:  

Version 0.6 ready for testers
This has involved massive internal restructuring and should be considered beta quality. Feedback especially welcome from anyone with an unusual setup. The major highlights are:
optional password saving
cifs support if you have it in your kernel (it is included by default in puppy 2.14R) may not work with samba servers
much improved handling of servers and shares with funky characters in their names
user variable network scan duration
the mountpoints have moved to /mnt/network

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss

Edited_time_total
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Tue 08 Apr 2008, 15:00    Post_subject:  

I'll recall my installation
Laptop (LT) and desktop (DT) WiFi connected to a rooter.
Name of DT = MD8818
Also LT and DT are connected through a Firewire (1394) connection.
LT = 10.0.0.11 and DT = 10.0.0.10

I downloaded and installed PNH 0.6 in Dingo 4 beta 1

Started pnethood without arguments.

Scanning is done and I have two tabs, a 10_0_0_10 and a MD8818
User guest, password unknown to me but has 5 positions. I didn't give a user or password anywhere.

I can mount the shared resource as well via 10_0_0_10 as MD8818
They are available as expected in /mnt/network.

I don't know if cifs is installed in Dingo 4 beta 1, so I didn't try.

So apart from that user/password issue, I think PNH 0.6 is working so far.

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Tue 08 Apr 2008, 16:59    Post_subject:  

Béèm wrote:
User guest, password unknown to me but has 5 positions. I didn't give a user or password anywhere.
Glad it works, thanks for the feedback Béèm.
I expect the password is guest. You could confirm this by checking the "save passwords" box, doing a refresh or quit and then looking in /root/.pnethood/passwords. This happens when the server fails to list its shares when smbclient asks for the list without giving a username and password. The next thing that pnethood tries is the guest account, if this works then it sets the username and password accordingly. By doing this I have managed to access the memory card holder in my HP C5180 AOI printer. It used to really bug me that pnethood showed it as a samba server but didn't show the memory card.

I presume it is possible on the server to set some shares as listable by guest and some that require a password. In this scenario pnethood will find the guest shares and stop scanning so it won't find the password listed shares. All this is hypothetical as I haven't read up on how to configure my XP box this way.

The cifs module is not included with dingo beta 1. Ticking the cifs box shouldn't cause a problem, you will get an error message each time you try to mount a share and it will be done automatically with smbmount instead.

As your shares are accessible to guest, hopefully there is no-one on your network that you don't trust.

I should have added to the release notes. Thanks to Disciple for fixing all the errors in the help file.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Tue 08 Apr 2008, 17:57    Post_subject:  

Hi Will,
Guest was a good guess then.
As a test I tried with another user, but pnethood reverted to guest.
I suppose the password is guest as well.
Confirmed when doing a save passwords and refresh.
But somehow strange anyway.
I have a Dutch XP (hate this) and the guest account is gast and isn't password protected.
And yet pnethood can use guest with a password.
But can't use another account with its password. (Or should I save password first?)

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Tue 08 Apr 2008, 19:57    Post_subject:  

Testing in both Dingo (alpha 6 I think) and Puppy 1.x:
1. The first time it is run it gets into some sort of eternal loop, and spits out this sort of message
Code:
/usr/local/apps/pnethood/pnethood: line 22: /root/.pnethood/pnethood.rc: No such file or directory
/usr/local/apps/pnethood/pnethood: line 24: /root/.pnethood/pnethood.rc: No such file or directory
FATAL: Module cifs not found.
rm: cannot remove `/tmp/pnethood/temp': No such file or directory
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
/usr/local/apps/pnethood/pnethood: line 376: 13011 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 13049 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 13110 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center

** ERROR **: gtkdialog: Error in line 31, near token '</default>': syntax error

aborting...
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
/usr/local/apps/pnethood/pnethood: line 376: 13137 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 13175 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 13236 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center

** ERROR **: gtkdialog: Error in line 31, near token '</default>': syntax error

aborting...
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
/usr/local/apps/pnethood/pnethood: line 376: 13263 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 13301 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 14273 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center

** ERROR **: gtkdialog: Error in line 31, near token '</default>': syntax error

aborting...
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
/usr/local/apps/pnethood/pnethood: line 376: 14300 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 14338 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 14399 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center

** ERROR **: gtkdialog: Error in line 31, near token '</default>': syntax error

aborting...
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
/usr/local/apps/pnethood/pnethood: line 376: 14426 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 14464 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 14525 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center

** ERROR **: gtkdialog: Error in line 31, near token '</default>': syntax error

aborting...
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
/usr/local/apps/pnethood/pnethood: line 376: 14552 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 14597 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 14658 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center

** ERROR **: gtkdialog: Error in line 31, near token '</default>': syntax error

aborting...
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
/usr/local/apps/pnethood/pnethood: line 376: 14685 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 14723 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 14784 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center

** ERROR **: gtkdialog: Error in line 31, near token '</default>': syntax error

aborting...
/usr/local/apps/pnethood/pnethood: line 93: *1000: syntax error: operand expected (error token is "*1000")
The application 'gtkdialog3' lost its connection to the display :0.0;
most likely the X server was shut down or you killed/destroyed
the application.

The last bit is when I killed it obviously Smile

2. It fails to mount Windows 98 shares, for no apparent reason. It can mount shares on the same machine I run it on, but I haven't had a chance to try mounting shares on another linux machine.

3. When it is closed it spits out most of this, which doesn't look particularly healthy
Code:
# pnethood
FATAL: Module cifs not found.
/usr/local/apps/pnethood/pnethood: line 376: 14966 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
/usr/local/apps/pnethood/pnethood: line 376: 15005 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: line 1: 15917 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
/usr/local/apps/pnethood/pnethood: eval: line 352: unexpected EOF while looking for matching `"'
/usr/local/apps/pnethood/pnethood: eval: line 353: syntax error: unexpected end of file
/usr/local/apps/pnethood/pnethood: line 352: error: command not found
/usr/local/apps/pnethood/pnethood: line 352: /mnt/network/UPSTAIRS/C: is a directory
/usr/local/apps/pnethood/pnethood: line 352: not: command not found
/usr/local/apps/pnethood/pnethood: eval: line 352: syntax error near unexpected token `in'
/usr/local/apps/pnethood/pnethood: eval: line 352: `in'
/usr/local/apps/pnethood/pnethood: eval: line 352: unexpected EOF while looking for matching `"'
/usr/local/apps/pnethood/pnethood: eval: line 353: syntax error: unexpected end of file


4. I also saw this at one stage, but i forgot the circumstances Embarassed
Quote:
[mntent]: line 1 in /etc/mtab is bad
[mntent]: line 2 in /etc/mtab is bad
[mntent]: line 3 in /etc/mtab is bad
[mntent]: line 4 in /etc/mtab is bad
[mntent]: line 5 in /etc/mtab is bad; rest of file ignored
[mntent]: line 1 in /etc/mtab is bad
[mntent]: line 2 in /etc/mtab is bad
[mntent]: line 3 in /etc/mtab is bad
[mntent]: line 4 in /etc/mtab is bad
[mntent]: line 5 in /etc/mtab is bad; rest of file ignored

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Sat 12 Apr 2008, 11:13    Post_subject:  

Ah. It mounts Linux shares fine, so there must be something different between Win98 and Linux shares, that is causing a hiccup with this version
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Sun 13 Apr 2008, 10:03    Post_subject:  

thanks disciple

1. Is partly caused by it writing an rc file on first run and then immediately trying to read it, inserting a sync should help. The design of the main loop causes it to continue looping unless the gtkdialog exit status is QUIT so when gtkdialog crashes due to an invalid dialog definition it keeps looping. I can adjust the logic of the loop.

2. I'm assuming you have a mount button but clicking it just leads to an error message. Maybe inserting something like
gxmessage "$@"
at the top of /usr/local/apps/pnethood/func_mount would allow you you to check that the parameters being passed are sensible.
Is this the server with a space in its name?

3. It calls eval on each of the output lines from the gui. There are a couple of fields which contain more than just variable assignments. The shell is just complaining about not being able to evaluate one of them. It is unlikely that this is actually causing a problem but it potentially could. I will stop these from being evaluated.

4 :shrug, dunno

I've just realised that the code for handling lots of servers doesn't work properly for several reasons. I think I will remove the automatic insertion of username guest password guest. I will still scan for these shares and maybe mark which shares on a host can be accessed as guest.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Sun 13 Apr 2008, 18:42    Post_subject:  

2. OK, I'll try that. Yes, I do have a mount button, and no, it is any Win98 server, not just one with spaces.
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Sun 13 Apr 2008, 20:59    Post_subject:  

Code:
TOMS 192.168.2.36 C /mnt/network/TOMS/C   false

I guess this looks sensible. Is the "false" about password saving?

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Sun 13 Apr 2008, 21:13    Post_subject:  

It looks like there is also still a separate issue with servers with spaces in their names. I'll have to wait to test properly when I get a chance to boot "Green room" into Puppy so that I can actually mount the shares.
Check out this:
Code:
/pnethood-0.6/usr/local/apps# ./pnethood/AppRun
modprobe: Can't locate module cifs
./pnethood/pnethood: line 376:  4931 Terminated              gtkdialog3 --program=MSG_SCANNING_NETWORK --center
./pnethood/pnethood: line 376:  4976 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
./pnethood/pnethood: line 376:  5065 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
./pnethood/pnethood: line 376:  5102 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
./pnethood/pnethood: line 352:  5146 Terminated              gtkdialog3 --program=MSG_SCANNING_MACHINE --center
./pnethood/pnethood: eval: line 352: unexpected EOF while looking for matching `"'
./pnethood/pnethood: eval: line 353: syntax error: unexpected end of file
./pnethood/pnethood: line 352: error: command not found
./pnethood/pnethood: line 352: /mnt/network/GREEN: No such file or directory
./pnethood/pnethood: line 352: ROOM/F: No such file or directory
./pnethood/pnethood: line 352: not: command not found
./pnethood/pnethood: eval: line 352: syntax error near unexpected token `in'
./pnethood/pnethood: eval: line 352: `in'
./pnethood/pnethood: eval: line 352: unexpected EOF while looking for matching `"'
./pnethood/pnethood: eval: line 353: syntax error: unexpected end of file

I started the program, tried to mount a share on "Green Room", it failed, and then I when I closed the program I got those errors in line 352.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 6 of 20 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, ..., 18, 19, 20 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1297s ][ Queries: 12 (0.0091s) ][ GZIP on ]