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: Select all
if [ -d /opt/samba ];then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/samba/lib"
PATH="$PATH:/opt/samba/bin"
fi
Code: Select all
if [ -d /opt/samba ];then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/samba/lib"
PATH="$PATH:/opt/samba/bin:/opt/samba/sbin"
fi
3.) to get Samba server to start, stop, and restart on command you can create the following file, /etc/rc.d/rc.samba:
Code: Select all
#!/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
Code: Select all
chmod 755 /etc/rc.d/rc.samba
Now, typing the following into the console should start the server:
Code: Select all
/etc/rc.d/rc.samba start
Code: Select all
/etc/rc.d/rc.samba stop
Code: Select all
/etc/rc.d/rc.samba restart
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: Select all
smbpasswd -a george
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.