April 18th, 2004, 11:49
I'm running 4.7 on a home network with a router to cable modem.

Being unaware of the 'start' and 'stop' arguments I made a one-line script to start the smbclient, named, made it executable, and stuck it in /usr/local/etc/rc.d:

smbclient -L piii -U steve -N

I forget the message at boot, but it never did start. I shut down and restarted. Now smbd won't start. In the samba log file for smbd it says:

[2004/04/18 11:24:15, 0] lib/util_sock.c:open_socket_in(804)
bind failed on port 139 socket_addr =
Error = Address already in use

How do I get smbd to start again? How should I properly write the script to start smbclient?


April 18th, 2004, 12:11
Is your host IP set to in the smb.conf? If so, change it to the IP set on your host. See if that helps any.

April 18th, 2004, 13:20
That worked!

This pc connects to the router via dhcp. I uncommented a line in smb.conf that said:

hosts allow = 192.168.1. 192.168.2 127.

I was able to start the smbd daemon and to successfully run smbclient. I rebooted and smbd started fine.

Whew! One step forward again. Thanks.

Any suggestions for a script to start smbclient at boot time? There are a couple of pages about startup scripts in the book Absolute BSD and I only understand the syntax partially. How about:

#--script begin
case "$1" in
smbclient -L piii -U steve -N
killall smbclient
#--script end

Would that suffice?

April 18th, 2004, 16:09
It can be as simple as a script like this in your /etc/rc.local:

[code:1:f2097c5393]if [ -x /usr/local/sbin/daemonx ]; then
echo -n ' daemonx'; /usr/local/sbin/daemonx

April 19th, 2004, 09:49
If you are just trying trying automount a smb share at bootup then you can use fstab to mount it. You can put a .nsmbrc file in root's directory for the username/password (you won't need this if guest is enabled on the smb server). You can find the examples to set it up in /usr/share/examples/smbfs/dot.nsmbrc. Regular users can use this too as long as they have permissions to mount a share in the first place.

Here's the gist of it.


I looked into this option when I was trying to connect some OS X clients to a samba server. I realized that I could use Netinfo instead but that won't help you for this. :roll:

April 20th, 2004, 02:49
Well, I think that worked.

I copied /usr/share/examples/etc/nsmb.conf to /usr/local/etc/nsmb.conf instead of using .nsmbrc in one of the home directories so it would mount no matter what user was logged in (right now it's just me and my friend root.)

I modified nsmb.conf with these lines and it mounts as soon as the first user logs in:





This is for a server named PIII, a user named GUEST, and a share named STEVE. Since I am using a router, I made the address the address of the router with the additions 'piii' as the host. Sound kosher?

Thanks for your help,

April 20th, 2004, 09:23

This just needs to be an IP address so you can drop the piii here.

//PIII/steve /some/mountpoint smbfs rw 0 0[/code:1:311147fd33]

Does you /etc/fstab have an entry something like this?

Since I am using a router, I made the address the address of the router with the additions 'piii' as the host.

Unless samba is running on the router or the router is doing some kind of port forwarding then you should use the actual IP address of the box running samba.