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 Fri 28 Nov 2014, 21:32
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Muppy-SMB to find and mount shared network-folders (final?)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [39 Posts]   Goto page: 1, 2, 3 Next
Author Message
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Tue 21 Nov 2006, 17:30    Post subject:  Muppy-SMB to find and mount shared network-folders (final?)  

This dotpup tries to find shared folders of Windows or Linux computers in a local network.
It mounts only folders without password-protection.

You also can share a folder (/root/shared) on your computer for the network.

Download
http://dotpups.de/dotpups/System_Utilities/getdir.pup
http://dotpups.de/dotpups/Network/Muppy-SMB.pup (1.6 MB)

If you have a old Puppy (2.10 or older), you must install PuppyBasic 2.5 as alien Package:
http://ftp.nluug.nl/ftp/pub/os/Linux/distr/puppylinux/pupget_packages-1/puppybasic-2.5.tar.gz


If you run Muppy-smb from the dotpups-menu, you get a dialog.

Screenshot:





You also can run it with a parameter, then no dialog appears:

This mounts all shares available to /mnt/Network/:
Muppy-smb -codepage 850

This mounts them with a german codepage, and opens /mnt/Network/ in Rox:
Muppy-smb -codepage 437 -rox

This unmounts them:
Muppy-smb -umount

For more info about sharing folders, read Rarsas great HowTo:
http://www.murga-linux.com/puppy/viewtopic.php?t=2163

Mark

Last edited by MU on Sun 14 Jan 2007, 17:25; edited 6 times in total
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Wed 22 Nov 2006, 07:03    Post subject:  

MU; I'll try it tomorrow, it's late now.
It sounds a lot like a neo LinNeighborhood & also the boot mount util. I worked on.
I assume it'll also find Samba shares as well as Win. shares (it should).
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 22 Nov 2006, 07:18    Post subject:  

Quote:
I assume it'll also find Samba shares as well as Win. shares (it should).


I think so too.
Will try to set up samba-shares at work later Smile
Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 22 Nov 2006, 14:37    Post subject:  

I updated the dotpup.
It now checks, if the created folders are really mounted.
If not, and if they are empty, they will be deleted.
This also happens when you unmount.

So your folderstructure stays "clean".

Folders with a "$" in the name will not be mounted, as it seems that they are temporary folders from Windows, like "print$".


So what remains to be done:
- speed things up.
As I added smbtree later, I do not use it yet to determine the foldernames.
Using it might be faster, as I could skip a loop.
- add some buttons to the dialog, like a help with Rarsas HowTo and LinNeighbourHood to be able to mount (protected) folders manually.
- detect german languagesettings to set -codepage 437 automatically?

Mark
Back to top
View user's profile Send private message Visit poster's website 
Goble

Joined: 30 Jun 2006
Posts: 21

PostPosted: Wed 22 Nov 2006, 15:02    Post subject:  

Share names with trailing $ -char are "hidden" shares in Windows, not temporary shares. One can create a share name using $ as a last char to hide the share from other workstations on the network. Clients must know the exact name of the share to map it (ie using \\mypchost\files$ as a share name in file explorer or net use command).
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 22 Nov 2006, 16:01    Post subject:  

ok, thanks, so it is ok not o mount them I think.
If someone explicitly wants to use hidden folders, he could use them with LinNeighbourHood Smile

Mark
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Wed 22 Nov 2006, 21:49    Post subject:  

Mark; I installed getdir.pup & Muppy-SMB.pup, & clicked for English.
Then I ran mount & no shares were mounted
There are 3 LAN shares & 2 local, I used LinNeighborhood to test mount them.

I couldn't make smbstatus give me any share info (weard), I didn't try much.
I used: "smbtree -N -S" to get WorkGroups & Hosts.
And used: "smbclient -L $HOST" to get that host's shares.
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 23 Nov 2006, 10:11    Post subject:  

you could run it from a console, and post the output here.
Mark
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Fri 24 Nov 2006, 06:33    Post subject:  

I'm running Puppy-1 (duh), should be Muppy... right? (gee, I wonder if that's it?)
In case it might help, here's the complaint:

# ./Muppy-smb
101
# [Syntax error]
Expected an expression
in file "Muppy-SMB", line 29:
allmachines = xwin_system("./smbtree -N| tr -s ' '|cut -f2|grep '\\\\'|sed 's/\\\\//g'")
^

*** glibc detected *** double free or corruption (top): 0x080aeee0 ***

#


And hey! The picture's cool... you look like a rock star!
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 24 Nov 2006, 06:50    Post subject:  

I see, you use an old ersion of Puppybasic, that does not support xwin_system() yet.
Please upgrade with with pupget or using this unleashed package:
http://ftp.nluug.nl/ftp/pub/os/Linux/distr/puppylinux/pupget_packages-1/puppybasic-2.5.tar.gz


Quote:
And hey! The picture's cool... you look like a rock star!

*lol* ok, if I just had the money and groupies Wink

I recently bought a webcam, that unfortunately is not supported by Puppys drivers (was extremely cheap, so I did not check in advance). Made a testvideo in XP then, that's what I took the picture from.
http://dotpups.de/pics/diverse/mark-nov-2006.avi

Mark
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Fri 24 Nov 2006, 08:15    Post subject:  

Success! It's late & all the other PCs are off, but it mounted both browsable shares on this one.
Tomorrow I'll try it again with all the PCs on, if there's errors I'll post back.

NOTE: LinNeighborhood defaults to making mount dirs. in /root, & there were problems with Puppy trying to backup the shares at shutdown, etc.
In Puppy1 all you had to do was set LinNeighborhood to make the dirs. out of /root.
In Puppy2 the SAVE file covers everything, so I don't know how to deal with it,
other than modifing Barry's code to unmount all shares before backing up.
Barry may have already taken care of this, I don't know...
You may be aware of this, or it may not matter, but I thought I'd mention it.
Here's the report:

# ./Muppy-smb
101
# Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
mounting: /root/network/PUPSERVER/docs
###### //PUPSERVER/docs on /root/network/PUPSERVER/docs type smbfs (rw,nosuid,nodev,file_mode=0755,dir_mode=0755,codepage=cp)

mounting: /root/network/PUPSERVER/public
###### //PUPSERVER/public on /root/network/PUPSERVER/public type smbfs (rw,nosuid,nodev,file_mode=0755,dir_mode=0755,codepage=cp)
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 24 Nov 2006, 09:39    Post subject:  

Maybe I should mount them in /mnt/NetWork or /var/NetWork.

Then I could create a symlink NETWORK in /root so that it is easily found.
Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 24 Nov 2006, 15:04    Post subject:  

Updated the dotpup, there was a potential bug with multiple domains.

I also tested a new version, that was slightly faster.
But it had a new problem: the Printer-folders were displayed as illegal entries in Rox.
Did not find out the reason.

The old version ran more stable, so I'll stay with that.
If someone wants to test my rejected new trial anyway, replace this file:
http://dotpups.de/tests/neu/Muppy-SMB

But I encountered another strange thing in both versions:
I just can mount 3 shares, after that I get a connect-error in the console.
It is not related to a special folder, as my new program sorted the entries differently.
The old version did not mount //TORSTEN/Dokumente, the new one TORSTEN/SharedDocs.

If it might be related to the maximum possible amount of loop-devices?
I'm puzzled about it, and have no idea at moment.


Mark
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Fri 24 Nov 2006, 19:10    Post subject:  

Hey Mark; I tried the newer script & nothing, this is all it output:

# ./Muppy-smb2
sh: ./smbtree: not found
.....UN-mounting
.....now mounting
sh: ./smbtree: not found

smbtree isn't in the dir. /usr/local/bin, so that's it...

###################
The old script sub dir. all hosts it found under the one before it:

# ./Muppy-smb
101
# mounting: /root/network/60GB//ME//PUPSERVER/MUSIC
###### Nothing
COULD NOT MOUNT
rmdir: `/root/network/60GB//ME//PUPSERVER/MUSIC': Device or resource busy
mounting: /root/network/60GB//ME//PUPSERVER/0

The hosts are: 60GB, ME, PUPSERVER... & MUSIC is the share.
It did this with all the shares, some mounted & some did not... of course.
It looks to be a simple dir. creation problem.

###############
I've made a short "mount everything" script, if you want to try it...
It'll smbmount, smbumount, & a test mode, you'll see it at the top.
It makes the mount dirs. in /tmp/smb, & they're one dir. deep (60GB_MUSIC)
You may want to mess with it, or I'll be glad to modify it for you...
It'd make a nice GUI with 2 ListBoxes, 1 = Hosts & 2 = Host's Shares.
NOTE: The test output may report something like this (just ignore it):
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
smbmount-all.gz
Description  May the Holidays bring Fortune & Joy!
gz

 Download 
Filename  smbmount-all.gz 
Filesize  516 Bytes 
Downloaded  652 Time(s) 
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Mon 27 Nov 2006, 15:04    Post subject:  

ok thanks., I'll have a look a wednesday at work.
Good to have another trial Very Happy

Quote:
sh: ./smbtree: not found

you must run it in the folder with smbtree, so replace
/usr/local/Muppy-SMB/resource/Muppy-SMB with it.

But forget it, because...


...today I tested further, and encountered this:
neither LinNeighbourhood nor smbtree listed both Computers with shares in our network.
They are TORSTEN and KLEINER, but only one was visible.

I finally managed to build a script that lists both.

http://dotpups.de/tests/SMB-tests/testscript

the output will look like this:
sh-3.00# ./testscript
TORSTEN/SharedDocs
TORSTEN/Exceldateien
TORSTEN/C
TORSTEN/Dokumente
KLEINER/SharedDocs
sh-3.00#

It does not mount or so, justs lists those folders, so that I can use it as an external tool to call from my Puppybasic-script.
Might be enhanced, for example it would work erratic, if you had two computers called "PUPPYPC".

To understand better how it works, I added some notes on the commands here:
http://dotpups.de/tests/SMB-tests/neushell.txt

Unfortunately every version does list far not all folders that are shared.
No idea why.

I also had this problem:
Quote:
NOTE: The test output may report something like this (just ignore it):
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]


The reason:
it is sent to the errorchannel "stdout".
You can suppress that with
thecommand 2>/dev/null

Mark
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 3 [39 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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