# Samba problem: lpstat, swat.  WHAT AM I DOING WRONG ?

## Blackace

First off samba starts just fine unless I use the smb.conf.example file as a template for my smb.conf, if I do then samba spits out

```
lpstat: Unable to connect to server: Connection refused
```

If I have a blank smb.conf file, then samba starts fine, but in both cases swat won't work.

In my /etc/services file, I have by default a "swat 901/tcp" entry.  Since I didn't have an /etc/inetd.conf file, I assumed that I needed either inetd or xinetd, so I emerged xinetd and did rc-update add xinetd default, and made sure that the /etc/xinetd.d/swat file listed the correct path to swat (/usr/sbin/swat).

xinetd starts fine, but still no swat.  I haven't done anything that I would consider to be weird, but the one thing that I could think of as causing this is that I can't ping a windows 2000 machine on my local network by it's WINS name (I can however ping it by IP address).  All of the machines on my local network have visible IP addresses and use local firewalling (I know, bad idea, but I'm working on fixing this).

I can resolve host names and IP addresses just fine, I can see any site with lynx, but lynx http://localhost:901/ just doesn't work.

If anyone has any ideas, or advice, PLEASE let me know.

Thanks,

Blackace.

----------

## taskara

try webmin - you can configure samba from there, and there's also a link to swat

just a thought

----------

## taskara

do you have any printers setup at all ?

if not then you can take out that line in smb.conf file.

if you do then something's weird, but you don't need it if you specify all your printers individually

----------

## Blackace

 *taskara wrote:*   

> do you have any printers setup at all ?
> 
> if not then you can take out that line in smb.conf file.
> 
> if you do then something's weird, but you don't need it if you specify all your printers individually

 

It's not really the printer thing (lpstat, cups) that's the problem, when I mentioned the lpstat error, I was just illustrating why I couldn't use the smb.conf.example file for my smb.conf, and why I wanted swat to work. (so I could create a new smb.conf with it).

At this point all I want to do is get swat running so I can setup my smb.conf file.

Any ideas taskara ?

btw, thanks for helping me out,

Blackace.

----------

## taskara

a couple of things.

you could just edit it directly like I do - it's pretty easy to follow.

I've never really used swat, except one time when I saw it in webmin.

i'd have to read the doco to see how to get swat working.

have you emerged webmin? you can edit it there also, and there's a link to swat.

emerge webmin

then browse to http://youripaddress:10000

ie:

http://192.168.0.1:10000

and log in with username, root

and your root password.

have a play around.

if that's no help, try the doco on getting swat to work, or checkout the samba webpage.

or try editing the file directly  :Smile: 

----------

## Blackace

I got swat to work (I didn't set disabled=no in my /etc/xinetd.d/swat file)  :Embarassed: 

But samba between W2K and Gentoo still won't work, I'm sure the reason is that I can't ping my W2K box by it's NetBIOS name, but I don't know where to start troubleshooting since I can ping anything else by ip or hostname.

Any pointers/gotchas anyone ?

Thanks,

Blackace.

----------

## taskara

add an entry for your win2k box into your /ets/hosts file

.. that should get your ping working at least..

----------

## Blackace

 *taskara wrote:*   

> add an entry for your win2k box into your /ets/hosts file
> 
> .. that should get your ping working at least..

 

I've tried that, and it does get the ping working, but that isn't using the NetBIOS name, that just aliases the ip to a name...I need the NetBIOS name to work before samba can even be expected to work properly.

Blackace.

----------

## mksoft

Why do you need the netbios name  :Question:  You can connect with an ip as well. The problem seems different.

By can't connect what do you mean  :Question:  A password is requested  :Question:  A connection is refused  :Question: 

----------

## taskara

post your smb.conf file, and we'll check it out..

----------

## Blackace

Ok, I've gotten everything working...the problem was my W2K boxes wouldn't use the WINS server that Samba provides, so they never registered themselves with Samba.

Thanks for your help guys !!!

Blackace.

----------

## Rob W

Any chance you could tell us how you resolved the Samba/WINS issue with your Win2K boxen?  I'd appreciate it.

Rob W.  [/b][/i]

----------

## Blackace

Basically, once I set up my smb.conf file properly and I put the IP address of my Samba Gentoo box into the WINS tab of the TCP/IP properties dialog on the Win2K boxen, AND configured the firewalls thereof for the IP address of my Samba Gentoo box, everything works dandy.

If you'd like I can post my smb.conf file and maybe help you with your problem if I can.  (after all, I only read every samba doc I could find before seeing the obvious.   :Confused:  )

Blackace.

----------

## Rob W

lpstat: Unable to connect to server: Connection refused

I had this same error while using cups and samba.  It appeared at boot and I traced the problem to the smb.conf file.

The printcap name variable must be set to cups, not lpstat

```
printcap name = cups
```

Of course this assumes you're using cups.

You may have already fixed this problem by now, but just in case...

Rob W.

----------

## Blackace

Yeah, I have it set to cups, and that wasn't really the problem anyways...the REAL problem was my "overzealous" firewalling on the Win2K boxen.  But in my opinion you can never be overzealous about firewalls.

(I kinda/sorta needed to update my firewall configs on the Win2K boxen to reflect the damn IP address changes that occurred every time I restarted my Gentoo box...then everything tends to work a WHOLE LOT better!) Duh.

Thanks for following this thread anyways...any admins around could go ahead and lock this post, or commit it to tips/docs under "WIN2K FIREWALLING, SAMBA, AND DYNAMIC IP ADDRESSING".   :Rolling Eyes: 

Thanks,

Blackace.

----------

## chromeless

Blacklace your earlier threads completely describes the problems I have been having also configuring samba on my box and my face started to light up a bit ...   :Laughing:  but then my problems is everything starts up fine including smbd but then the only thing is nmbd refuses to start up. 

FYI i am running samba on my box with a dialup and my hostname is localhost. Can some one help me ?

----------

## Blackace

chromeless, first of all you need to post some more info about your problem.

What are you trying to set samba up to do ?

What error message do you get when nmbd fails to start ?

Do you have xinetd installed/set up ?

I can't guarantee anything, but I'll try to figure out if you are having any of the same problems I have had, then tell you how I fixed them.

Blackace.

----------

## chromeless

Well this is what I am trying to do :

1. I am trying to control samba server through zope

2. Error I get is 'no interface found' when i do a tail /var/log/log.nmbd

3. How do i get the samba status of the server through python ?

Many thanks in advanced

[/list]

----------

