# SAMBA, CUPS & problems with network.

## .Justin

Hello,

I've been following the directions provided by the quick samba how to guide in the documentation, however I've ran in too two different problems.

Problem number one is, errors when trying to view my samba shares (via smbtree on the terminal window), my two work groups show up, however only one computer shows up under a share where as the other two under work group "shreve" do not show up. There should be two more computers showing up under SHREVE (\\PAVILION a Windows 98 and  \\DELLPRECISION a Windows 2000). If it's important, my share (\\RENEGADE) shows up under windows however they get an error when trying to access it) The output of the smbtree command is below:

```
# smbtree

WORKGROUP

        \\OLDAVERATEC

SHREVE

```

Not sure if it is related, but when I start samba (with /etc/init.d/samba start or restart) I following happens:

 *Quote:*   

> # /etc/init.d/samba stop
> 
>  * samba -> stop: smbd ...                                                                                                                                                   [ !! ]
> 
> * samba -> stop: nmbd ...                                                                                                                                                   [  ok  ]

 

So I'm not entirely sure why an error occurs when samba is restarted or stopped or if it has to do with the above.

The second problem that I'm having (that might be related to my shares not being shown) is that CUPS is returning an error when I try to run the cupsaddsmb command.

The full command that I run is:

```
# cupsaddsmb -H localhost -U root -h localhost -v HP6MP
```

And the output is:

```
Password for root required to access localhost via SAMBA:

Running command: rpcclient localhost -N -U'root%<password>' -c 'setdriver HP6MP HP6MP'

Error connecting to 127.0.0.1 (Connection refused)

cli_full_connection: failed to connect to LOCALHOST<20> (127.0.0.1)

Cannot connect to server.  Error was NT_STATUS_UNSUCCESSFUL
```

.

The following is my smb.conf file.

```
[global]

server string = Samba Server %v

netbios name = renegade

workgroup = shreve

load printers = yes

browseable = yes

printing = cups

printcap name = cups

encrypt passwords = yes

lock directory = /usr/local/samba/var/lock

interfaces = lo eth0

bind interfaces only = yes

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

security = share

hosts allow = 192.168.1. 192.168.2. 127.

guest account = samba

guest ok = yes

log file = /var/log/samba/log.%m

max log size = 50

wins support = yes

name resolve order = wins lmhosts hosts bcast

client schannel = no

# For Samba 3.x. This enables ClamAV on access scanning.

#vfs object = vscan-clamav

#vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

[print$]

comment = Printer Drivers

path = /etc/samba/printer

guest ok = yes

browseable = yes

read only = yes

write list = justin,root

[HP6MP]

comment = HP6MP Network Printer

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

printer admin = justin,root

[printers]   

comment = All Printers

browseable = no 

printable = yes   

writable = no

public = yes   

guest ok = yes

path = /var/spool/samba

printer admin = justin,root

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/justin/public
```

And finally, my cupsd.conf file.

```
ServerName localhost

ServerAdmin (email removed)

AccessLog /var/log/cups/access_log

DefaultCharset utf-8

DocumentRoot /usr/share/cups/docs

ErrorLog /var/log/cups/error_log

LogLevel info

PageLog /var/log/cups/page_log

User lp

Group lp

Port 631

MaxClients 100

BrowseAddress @IF(net.eth0)

SystemGroup lp

<Location />

Order Deny,Allow

Deny From All

Allow From 127.0.0.1

Allow From localhost

</Location>

<Location /admin>

AuthType Basic

AuthClass System

Order Deny,Allow

Deny From All

Allow From 127.0.0.1

</Location>
```

My other information is that I'm using 2.6.11-gentoo-r9 as my kernel version, my printer is connected to a windows share on a computer downstairs, which is a HP LaserJet 6MP. 

Edit: Here's also the testparm command output.

Thanks,

Justin.Last edited by .Justin on Sun Jul 31, 2005 8:55 pm; edited 1 time in total

----------

## lonrot_m

i have a question, does these ips r the ones that you use??

because you r only allowing these ips to use it

hosts allow = 192.168.1. 192.168.2. 127. 

by the way dont type ur ip  :Very Happy: 

----------

## .Justin

 *Quote:*   

> i have a question, does these ips r the ones that you use??
> 
> because you r only allowing these ips to use it.

 

127.0.0.1 stands for localhost and is not an IP address for one specific place. The other two are internal addresses set by the router (dbz address) (someone correct me if I'm wrong). Also, I've read through the documentation, and most specify the addresses used by the network (dbz address), in this case 192.168.x.xx.

Anyone have any ideas on the problem?Last edited by .Justin on Sun Jul 31, 2005 5:21 pm; edited 1 time in total

----------

## lonrot_m

hi

i know that 127 is for localhost but the others two aren't exactly ips that your router had try looking your ips in the other comps control panel --> connections --> then you click on one --> n in the left you should see a dialog where your ip is stated or try run --> cmd --> ping (the name of your computer)

----------

## .Justin

I now how to get my IP address, and I know what it is, none of the above information should be able to harm me in anyway, however that's not even my problem at hand! (Plus those directions are for Windows, I'm already on Gentoo). If you look back up I'm having trouble with samba and cups right now.

Anyone have any ideas about the problem at hand?

----------

## m_sqrd

did you try testparm on your config file ?

----------

## .Justin

No, I haven't, however here is the output:

```
# testparm

Load smb config files from /etc/samba/smb.conf

Processing section "[print$]"

Processing section "[HP6MP]"

Processing section "[printers]"

Processing section "[public]"

Loaded services file OK.

ERROR: lock directory /usr/local/samba/var/lock does not exist

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions
```

Well, it's odd that it tells me theres no lock directory, however, I don't even have a samba directory in /usr/local/, am I missing something?

----------

## m_sqrd

well if you look at your config file you say you do see line

lock directory = /usr/local/samba/var/lock 

that is the first thing I think you need to fix to get the smbd running.

----------

## .Justin

Ah, thanks. smbd and nmbd are both stopping and starting correctly now, however I'm still having a problem viewing the network.

----------

## m_sqrd

ok what (see dose not see ) what, gentoo see windows box(s) and windows(s) dose not see it or what? do the windows box see each other ?

----------

## .Justin

All three Windows boxes can see the Gentoo machine, but get an error when trying to connect, I cannot see nor connect to any of the three windows boxes., However all the Windows boxes can see and connect to each other.

----------

## m_sqrd

ok what dose the log "log file = /var/log/samba/log.%m " have to say?

 all so what dose ifconfig -a show?

----------

## .Justin

Here's the output of some of the log files

 *Quote:*   

> # ls /var/log/samba/
> 
> log.0.0.0.0        log.192.168.1.102  log.192.168.1.108  log.dellprecision  log.shrevesony
> 
> log.127.0.0.1      log.192.168.1.103  log.192.168.1.116  log.nmbd           log.smbd
> ...

 

Looks like the connection IS being reset, and it's failing to sync with the work group.

ifconfig -a shows another item "sit0", along with the normal eth0 and lo devices. Do I need to add sit0 to my interfaces in the smb.conf file? (interfaces = lo eth0 )?

----------

## m_sqrd

ok you can't see the windows box(s) becouse of this from the file

<renegade justin # tail /var/log/samba/log.nmbd>

find_domain_master_name_query_fail:

Unable to find the Domain Master Browser name SHREVE<1b> for the workgroup SHREVE.

Unable to sync browse lists in this workgroup. 

i'd look at the line in your conf 

name resolve order = wins lmhosts hosts bcast 

do you have a wins server running are the other systems in your lmhosts or host files

then  your get a passwd errro here from the file 

< renegade justin # tail /var/log/samba/log.dellprecision>

[2005/07/31 07:31:54, 1] auth/auth_util.c:make_server_info_sam(822)

User samba in passdb, but getpwnam() fails! 

 try /etc/init.d/samba stop

 remove the logs  

 (man that stuff was hard to read) or move them some place else so we can see what new/current.

 edit your /etc/conf.d/samba and and -d 10 to the lines 

  smbd_start_options=

 nmbd_start_options=

 * (to bump up the logging level adj back when you have it working the way you like)

 then restat samba and lets take a look.

----------

## .Justin

No I do not have a WINS server running so I've removed that part of the configuration file, and no the other systems are not in the lmhosts or host files. Do they need to be in there? And if so how would I go about adding them?

I followed the directions about the log, however the logs are still full of the same information in the above post.

Thanks for your help so far.

----------

## m_sqrd

ok do this

/etc/init.d/samba stop

rm /var/log/samba/log/* 

/etc/init.d/samba start 

did you ad the flag's to the /etc/conf.d/samba file ? to bump up the log level

and when you added your samba user(s)  (how did you do it and did you set the passwd?)

----------

## .Justin

Yes, I've edited the /etc/conf.d/samba file and added the -d 10 lines.

Here are the two logs like you required earlier (i've uploaded them so they wouldn't take up as much room here/easy to read):

log.nmbd

and

log.smbd (larger file).

I didn't add any specific users for samba since they just use the system users, however I set my passwords with:

smbpasswd -a root 

and 

smbpasswd -a justin.

----------

## m_sqrd

ok you can bump the /etc/conf.d/samba line back down (I did not see any network/socket error)

it still not resolving ip to name so it still has UKNOW in the nmbd log file. 

also did not see any login attemp. no (somesystemname.log) but try

from the gentoo box smbclient -L //localhost -U your_user_name 

you may need to man smbclient to see if I'm right on the command line

and see if it give you an error. I have to go so I long back on tonight and see what up.

----------

## .Justin

Yup, I get an error when running the command (you were right about the syntax).

 *Quote:*   

> # smbclient -L //localhost -U justin
> 
> Password:
> 
> session setup failed: NT_STATUS_LOGON_FAILURE

 

Same error also shows up on smbtree now.

----------

## 59729

bump

https://forums.gentoo.org/viewtopic.php?p=2618250#2618250

----------

## m_sqrd

show me the output of emerge -pv samba 

I'm thinking this is a pam and the encrypt passwords = yes in your config.

----------

## .Justin

```
[ebuild   R   ] net-fs/samba-3.0.10  -acl +cups -doc -kerberos -ldap -libclamav +mysql +oav +pam -postgres +python -quotas +readline (-selinux) -winbind +xml +xml2 0 kB
```

Pam support was compiled in as I have it in my USE flags in make.conf.

----------

## .Justin

Not sure if it's related or not, however our whole network seems to be down/broken, no one can access each other. And indeed, I can't view any of the work groups with smbtree anymore (error is: failed session setup with NT_STATUS_LOGON_FAILURE).

----------

## m_sqrd

well if you thing it samba hanging the net work do a /etc/init.d/samba stop. 

and see if you other system come back after a while. 

ok I had a look at the link you posted first  and (the mysql and xml stuff) I do not think you need or wont. (do you have a mysql database set up for smb-passwds?)  your doing ever thing in the smbpasswd file are you not ? then re emerge samba with this flags off -mysql -xml -xml2

----------

## .Justin

Alright, I recompiled without xml, xml2 and mysql and also noticed any upgrade with emerge world. It appears that they are now getting a login screen for me, however I can still not connect to a Windows 200 Machine that is also on the network. (See first few posts).

Thanks.

----------

## m_sqrd

Ok so you can get to the 98 box and it can get to you(gentoo-box). and the 2000 box can get to you but you can't get to it? is that correct?

----------

## .Justin

The 98 box can get to me, and the XP box can get me, however the 2000 box can neither see me nor can I see it.

----------

## m_sqrd

Can all the windows box(s) see and talk to each other ? if so I think it sounds like the 2000 box as something off in its networking. Netbios over tcp/ip maybe.

----------

## .Justin

 *m_sqrd wrote:*   

> Can all the windows box(s) see and talk to each other ? if so I think it sounds like the 2000 box as something off in its networking. Netbios over tcp/ip maybe.

 

Yes, all the other boxes can see each other, it's just the gentoo and 2000 boxes having trouble.

----------

## m_sqrd

ok did you check the 2000s network settings and dose it have Netbio over tcp/ip check/on

----------

## .Justin

Sorry for the slow reply but yes, it it is on.

----------

## m_sqrd

hmm...

can you ping the 2000 and can it ping you?

----------

