| Author |
Message |
vtpup

Joined: 15 Oct 2008 Posts: 1077 Location: Republic of Vermont
|
Posted: Fri 28 Nov 2008, 03:06 Post subject:
How to Get Samba Server Working in Puppy 4 |
|
The Official Samba 3.0.26 .pet needs a little additional set-up work to get it starting (and stopping) on a Puppy 4 system.
Here's how:
1.) Install the server .pet with the Puppy Package Manager from the official repository.
2.) To get the smbd and nmbd commands properly in the Path, you can edit the /etc/profile file as follows:
Open it in Geany and do a find (Ctrl - F) for the word "samba". It should bring you to the following stanza:
| Code: | if [ -d /opt/samba ];then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/samba/lib"
PATH="$PATH:/opt/samba/bin"
fi |
Change The third line so you get the following:
| Code: | if [ -d /opt/samba ];then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/samba/lib"
PATH="$PATH:/opt/samba/bin:/opt/samba/sbin"
fi |
After saving the file and re-starting your computer, if you type smbd -D and nmbd -D in a terminal they should run
3.) to get Samba server to start, stop, and restart on command you can create the following file, /etc/rc.d/rc.samba:
| Code: | #!/bin/sh
#
# /etc/rc.d/rc.samba
#
# Start/stop/restart the Samba SMB file/print server.
#
# To make Samba start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.samba
#
samba_start() {
if [ -x /opt/samba/sbin/smbd -a -x /opt/samba/sbin/nmbd -a -r /etc/opt/samba/smb.conf ]; then
echo "Starting Samba..."
/opt/samba/sbin/nmbd -D
/opt/samba/sbin/smbd -D
fi
}
samba_stop() {
killall smbd nmbd
}
samba_restart() {
samba_stop
sleep 2
samba_start
}
case "$1" in
'start')
samba_start
;;
'stop')
samba_stop
;;
'restart')
samba_restart
;;
*)
# Default is "start", for backwards compatibility with previous
# Slackware versions. This may change to a 'usage' error someday.
samba_start
esac |
After saving that, set the file permission to executable
| Code: | | chmod 755 /etc/rc.d/rc.samba |
and re-boot.
Now, typing the following into the console should start the server:
| Code: | | /etc/rc.d/rc.samba start |
Stop the server:
| Code: | | /etc/rc.d/rc.samba stop |
And do a stop and a restart:
| Code: | | /etc/rc.d/rc.samba restart |
You should also get a bit of status feedback for these, not just an empty command prompt.
4.) I won't go into creating a Samba configuration file, as that is well covered in How-to's all over the internet -- everybody has their own take on that. What I would suggest is that you make it easier to modify your samba configuration file by installing a program that was recently removed from Puppy, GTKSamba
Also please note, your smb.conf file will be located in /etc/opt/samba -- don't forget the "/opt"
To install GTKSamba, open your Puppy Package Manager and pick the Puppy 3 repository (not the Puppy 4) and install GTKSamba and the GTK+ packages. Don't worry about the missing library error messages when first installing GTKSamba -- they will be added automatically with the GTK+ package.
5.) After installing and rebooting, open GTKSamba and go to File and pick Preferences and on the Local tab, set the Samba Configuration File entry to /etc/opt/samba/smb.conf and the Samba Restart Command to /etc/rc.d/rc.samba restart
6.) Once you have created and edited your samba configuration file, you may want to add Samba users and passwords (they should be the same as on your Windows boxes, if you have them). Note -- even though Puppy operates from the Root user, you can still add Samba users with a simple:
| Code: | | smbpasswd -a george |
for a username of george. This doesn't affect Puppy in any way and doesn't add a home directory for George -- it just creates a Samba user with that name and password.
7.) To test your system, after starting the server, you can simply open Pnethood on your same machine, and it should pick up the server and shares.
Well, that's it. Hope this helps.
Last edited by vtpup on Wed 31 Dec 2008, 22:04; edited 2 times in total
|
|
Back to top
|
|
 |
LaneLester
Joined: 14 Sep 2008 Posts: 209 Location: Rural Georgia, USA
|
Posted: Fri 28 Nov 2008, 08:44 Post subject:
Re: How to Get Samba Server Working in Puppy 4 |
|
| vtpup wrote: | | The Official Samba 3.0.26 .pet needs a little additional set-up work to get it starting (and stopping) on a Puppy 4 system. |
Thank you for explaining in such good detail. If I'm ever able to use Puppy for "real" work, this will be one of my needs.
Frankly, I would have thought that accessing a Windows printer on one's LAN would be a common enough need that this would be easier. But maybe not.
Since my idea of "a little additional set-up work" differs from yours, I won't try this until I'm able to run WeatherDisplay in Puppy. That's for my outdoor weather station, something I want to be able to watch, no matter which OS I'm running.
Lane
|
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6182 Location: Auckland, New Zealand
|
Posted: Fri 28 Nov 2008, 17:25 Post subject:
|
|
A samba server has nothing to do with being able to print to a shared Windows printer. Which is a good point - why on earth is cups still not set up for the smb backend in 4.1.1?
Anyway, the solution is at http://www.murga-linux.com/puppy/viewtopic.php?p=197562&search_id=79489125#197562
- you just need to create a link for the backend, and then restart CUPS.
_________________ DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Fri 28 Nov 2008, 17:59 Post subject:
|
|
The complete How-To is here. Unfortunately, Samba printing over a wireless network still seems to be hit-and-miss in Puppy.
|
|
Back to top
|
|
 |
vtpup

Joined: 15 Oct 2008 Posts: 1077 Location: Republic of Vermont
|
Posted: Fri 28 Nov 2008, 18:15 Post subject:
|
|
My intent here was to show how to get Samba Server running in Puppy 4. That was a problem, previously with this .pet release in Pup4.
What to do with it is another matter. Samba erver configuration is a huge topic with many different setups and possible solutions to individual problems. But I hope that will be in a separate thread (or threads) devoted to those topics.
|
|
Back to top
|
|
 |
LaneLester
Joined: 14 Sep 2008 Posts: 209 Location: Rural Georgia, USA
|
Posted: Fri 28 Nov 2008, 21:00 Post subject:
|
|
| rcrsn51 wrote: | | The complete How-To is here. Unfortunately, Samba printing over a wireless network still seems to be hit-and-miss in Puppy. |
Nuts! I followed the how-to, but no test page came through. OTOH, I also set up my network printer with the params that have always worked with other distros, and it didn't print, either.... and it's a wired connection between my computer and the network printer.
Lane
|
|
Back to top
|
|
 |
PaulBx1
Joined: 16 Jun 2006 Posts: 2308 Location: Wyoming, USA
|
Posted: Sun 21 Dec 2008, 17:25 Post subject:
|
|
According to the Samba official howto, the nmbd daemon needs to be started before the smdb daemon. So the script shown above ought to be modified. Maybe it works as is for your machine, but it might be more reliable generally if rearranged.
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Sun 21 Dec 2008, 17:55 Post subject:
|
|
| disciple wrote: | | Which is a good point - why on earth is cups still not set up for the smb backend in 4.1.1? |
Maybe because Puppy has never used a formal bug tracking system? This problem WAS identified in the 4.00 Beta bug reports.
|
|
Back to top
|
|
 |
vtpup

Joined: 15 Oct 2008 Posts: 1077 Location: Republic of Vermont
|
Posted: Tue 23 Dec 2008, 02:31 Post subject:
|
|
Edited script to start nmbd befor smdb.
|
|
Back to top
|
|
 |
tbuff2
Joined: 31 Dec 2008 Posts: 8 Location: Georgia, USA
|
Posted: Wed 31 Dec 2008, 14:18 Post subject:
|
|
I've followed all the instructions in this thread and can start smb and nmbd from a terminal, but cannot get them to start on boot-up or when I execute /etc/rc.d/rc.samba command (looking at "top" to see if they're running). I've made the rc.samba file executable and re-booted, but that didn't help. I don't mind manually starting them, but this way sounds a lot easier. Any help would be appreciated.
|
|
Back to top
|
|
 |
vtpup

Joined: 15 Oct 2008 Posts: 1077 Location: Republic of Vermont
|
Posted: Wed 31 Dec 2008, 16:39 Post subject:
|
|
To start the server automatically, open /etc/rc.d/rc.local in Geany and add the line:
| Code: | | /etc/rc.d/rc.samba start |
|
|
Back to top
|
|
 |
tbuff2
Joined: 31 Dec 2008 Posts: 8 Location: Georgia, USA
|
Posted: Wed 31 Dec 2008, 18:38 Post subject:
|
|
Thanks!!!
That did the trick. I also found that my smb.conf file was in /etc/opt/samba so I had to make that change in the script. Works like a charm now.
Thanks again.
|
|
Back to top
|
|
 |
vtpup

Joined: 15 Oct 2008 Posts: 1077 Location: Republic of Vermont
|
Posted: Wed 31 Dec 2008, 22:10 Post subject:
|
|
You're welcome.
And thanks for the catch. I must have had a smb.conf in /etc as well from earlier install attempts, so it didn't fail for me when I tested it.
Script edited to include /etc/opt/ subdirectory.
|
|
Back to top
|
|
 |
jrb

Joined: 11 Dec 2007 Posts: 972 Location: Smithers, BC, Canada
|
Posted: Sun 22 Mar 2009, 10:47 Post subject:
Can't get write access |
|
Hi,
I have installed samba-3.0.26.pet on puppy412 and followed the setup instructions in this thread, but I have only been able to get read access to my server.
I have made several attempts at smb.conf, modifying the original, copying from various websites but so far no write access.
Can someone post a smb.conf that will give me full read/write access to the /mnt directory of my server for all users?
Thanks, jrb
|
|
Back to top
|
|
 |
jrb

Joined: 11 Dec 2007 Posts: 972 Location: Smithers, BC, Canada
|
Posted: Sun 22 Mar 2009, 14:47 Post subject:
|
|
Have come up with a workable solution using: | Code: | # Global parameters
[global]
workgroup = Workgroup
netbios name = Server2
server string = Samba Server %v
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = No
local master = No
dns proxy = No
security = share
# Share
[public]
comment = root access
path = /mnt
valid users = root
public = yes
writable = yes
printable = no |
Turns out the samba user must be also added as puppy user. Tried a few different users without success then tried registering root as samba user and was able to get read/write access.
|
|
Back to top
|
|
 |
|