# Samba cannot do anything [SOLVED]

## mocsokmike

Hi all,

I have a recent installation of samba on one of the servers in my company. I never had such problems with samba before, though I don't have a deep knowledge of it. After google-ing around for a day I decided to post my problem here.

As I see from my syslog, it cannot find, read or write any files it has to use at runtime (?)...

This happens when I start samba:

```

N/A   carlsberg2   daemon    13:23:51    smbd    [2010/03/05 13:23:51, 0] printing/pcap.c:178(pcap_cache_reload)

N/A   carlsberg2   daemon    13:23:51    smbd    Unable to open printcap file /etc/printcap for read!

N/A   carlsberg2   daemon    13:23:51    smbd    [2010/03/05 13:23:51, 0] printing/pcap.c:178(pcap_cache_reload)

N/A   carlsberg2   daemon    13:23:51    smbd    Unable to open printcap file /etc/printcap for read!

N/A   carlsberg2   daemon    13:23:51    smbd    [2010/03/05 13:23:51, 0] smbd/server.c:457(smbd_open_one_socket)

N/A   carlsberg2   daemon    13:23:51    smbd    smbd_open_once_socket: open_socket_in: Address already in use

N/A   carlsberg2   daemon    13:23:51    smbd    [2010/03/05 13:23:51, 0] smbd/server.c:457(smbd_open_one_socket)

N/A   carlsberg2   daemon    13:23:51    smbd    smbd_open_once_socket: open_socket_in: Address already in use

```

This happens when I try to connect to a share:

```

N/A   carlsberg2   daemon    13:26:34    smbd    [2010/03/05 13:26:34, 0] lib/debug.c:663(reopen_logs)

N/A   carlsberg2   daemon    13:26:34    smbd    Unable to open new log file /var/log/samba/log.betabook: No such file or directory

N/A   carlsberg2   daemon    13:26:34    smbd    [2010/03/05 13:26:34, 0] smbd/map_username.c:140(map_username)

N/A   carlsberg2   daemon    13:26:34    smbd    can't open username map /etc/samba/smbusers. Error No such file or directory

N/A   carlsberg2   daemon    13:26:34    smbd    [2010/03/05 13:26:34, 0] lib/debug.c:663(reopen_logs)

N/A   carlsberg2   daemon    13:26:34    smbd    Unable to open new log file /var/log/samba/log.betabook: No such file or directory

N/A   carlsberg2   daemon    13:26:34    smbd    [2010/03/05 13:26:34, 0] lib/sharesec.c:53(share_info_db_init)

N/A   carlsberg2   daemon    13:26:34    smbd    Failed to open share info database /var/lib/samba/share_info.tdb (No such file or directory)

N/A   carlsberg2   daemon    13:26:34    smbd    [2010/03/05 13:26:34, 0] lib/sharesec.c:53(share_info_db_init)

N/A   carlsberg2   daemon    13:26:34    smbd    Failed to open share info database /var/lib/samba/share_info.tdb (No such file or directory)

N/A   carlsberg2   daemon    13:26:34    smbd    [2010/03/05 13:26:34, 0] passdb/pdb_get_set.c:210(pdb_get_group_sid)

N/A   carlsberg2   daemon    13:26:34    smbd    pdb_get_group_sid: Failed to find Unix account for root

N/A   carlsberg2   daemon    13:26:34    smbd    [2010/03/05 13:26:34, 0] smbd/service.c:1009(make_connection_snum)

N/A   carlsberg2   daemon    13:26:34    smbd    '/tmp' does not exist or permission denied when connecting to [IPC$] Error was No such file or directory

N/A   carlsberg2   daemon    13:26:30    smbd    [2010/03/05 13:26:30, 0] smbd/process.c:2082(smbd_process)

N/A   carlsberg2   daemon    13:26:30    smbd    Changed root to /home/samba/

N/A   carlsberg2   daemon    13:26:30    smbd    [2010/03/05 13:26:30, 0] lib/debug.c:663(reopen_logs)

N/A   carlsberg2   daemon    13:26:30    smbd    Unable to open new log file /var/log/samba/log.__ffff_10.0.0.30: No such file or directory

N/A   carlsberg2   daemon    13:26:30    smbd    [2010/03/05 13:26:30, 0] lib/debug.c:663(reopen_logs)

N/A   carlsberg2   daemon    13:26:30    smbd    Unable to open new log file /var/log/samba/log.__ffff_10.0.0.30: No such file or directory

```

The files and folders it is missing are there of course. /tmp is also world-accessible.

This should be an obvious and stupid mistake, but what? I use net-fs/samba-3.4.5.

Here is the output of testparm:

```

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

rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)

Processing section "[homes]"

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

[global]

        dos charset = 852

        unix charset = UTF8

        workgroup = LINUX

        server string = %h (samba %v)

        interfaces = 10.0.0.39/24

        map to guest = Bad User

        root directory = /home/samba/

        username map = /etc/samba/smbusers

        client NTLMv2 auth = Yes

        syslog only = Yes

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

        max log size = 50

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        os level = 33

        domain master = No

        dns proxy = No

        wins support = Yes

        admin users = root, rendszergazda, administrator

        hosts allow = 10.0.0., 127.

[homes]

        comment = Home Directories

        path = /home/%u

        read only = No

```

----------

## cassiol

helloo

 *Quote:*   

> 
> 
> Unable to open printcap file /etc/printcap for read! 
> 
> 

 

this file not exist, or smb user can't read this

 *Quote:*   

> 
> 
> can't open username map /etc/samba/smbusers. Error No such file or director
> 
> 

 

this file not exist, or smb user can't read this

you are running samba with root user?

if not, samba user need read/write permission on all listed directory

----------

## mocsokmike

Hi,

I wish it were that simple  :Sad: 

Regarding /etc/printcap you were right, it didn't exist. But with smbusers the case is different:

```
ls -l /etc/samba/smbusers

-rw-rw-rw- 1 root root 225 Mar  5 12:28 /etc/samba/smbusers
```

But in general you are correct, this looks like a file permission problem. I am investigating it at the moment...

----------

## mocsokmike

OK, managed to solve the problem. I believe this was the first and last time I tried to use SWAT. Back to the command-line config file editing instead, that way it works normally. Thanks for the tips!

----------

