Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[partially SOLVED] Samba won't bind to network at boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Markus09
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2013
Posts: 82

PostPosted: Sat Sep 28, 2024 7:30 am    Post subject: [partially SOLVED] Samba won't bind to network at boot Reply with quote

I recently setup a new Gentoo installation. On this I wanted samba to be available after boot to share data with a windows PC.

Thus on the Gentoo machine, samba is installed and added to the default runlevel. But it does not bind to the network (enp3s0) at boot. The network is using dhcpcd.
For debugging I enabled samba log level 3.

At first I tried using "net-online" in addition in the default runlevel and let samba need it: rc_need="net-online". But this did no change in observed behaviour, so I removed net-online.
The info I found in the log.smbd with net-online in use and without:
Code:
[2024/09/28 09:00:56.690164,  3] ../../lib/util/util_net.c:255(interpret_string_addr_internal)
  interpret_string_addr_internal: getaddrinfo failed for name enp3s0 (flags 32) [Temporary failure in name resolution]
[2024/09/28 09:00:56.690201,  2] ../../source3/lib/interface.c:500(interpret_interface)
  interpret_interface: Can't find address for enp3s0


Then I moved from the interfaces via "interfaces = lo enp3s0" to "interfaces = 192.168.1.0/24". This made it more critical, but I do not have an idea where to look next:
Code:
[2024/09/28 09:08:15.394647,  2] ../../source3/lib/interface.c:603(interpret_interface)
  interpret_interface: Can't determine ip for broadcast address 192.168.1.0/24
[2024/09/28 09:08:15.394688,  0] ../../source3/lib/interface.c:685(load_interfaces)
  WARNING: no network interfaces found
[2024/09/28 09:08:15.438420,  0] ../../source3/smbd/server.c:1258(open_sockets_smbd)
  open_sockets_smbd: No sockets available to bind to.


When I do a
Code:
/etc/init.d/samba restart

after boot, then samba starts as expected is accessible via network.

Do you have an idea where I could look next to solve this?

---

System infos:
Code:
net-fs/samba-4.19.6 acl pam python_single_target_python3_12 regedit system-mitkrb5


Code:
rc-status
Runlevel: default
 sysklogd                                                                                                                                 [  started  ]
 sshd                                                                                                                                     [  started  ]
 dhcpcd                                                                                                                                   [  started  ]
 netmount                                                                                                                                 [  started  ]
 chronyd                                                                                                                                  [  started  ]
 samba                                                                                                                                    [  crashed  ]
 local                                                                                                                                    [  started  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
Dynamic Runlevel: manual


smb.conf:
Code:
[global]
workgroup = Arbeitsgruppe
server string = Samba Server

# Logging, max 1MB log
log file = /var/log/samba/log.%m
max log size = 1024
log level = 3

interfaces = 192.168.1.0/24
bind interfaces only = yes

hosts allow = 127.0.0.1 192.168.1.0/24
hosts deny = 0.0.0.0/0

server min protocol = SMB3_11
server max protocol = SMB3_11

security = user

guest ok = no

[homes]
browsable = yes
valid users=%S
writeable = no
create mode = 0600
directory mode = 0700


Last edited by Markus09 on Tue Oct 01, 2024 7:14 am; edited 1 time in total
Back to top
View user's profile Send private message
Markus09
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2013
Posts: 82

PostPosted: Tue Oct 01, 2024 7:13 am    Post subject: Reply with quote

I found that using the "bind interfaces only" as active setting causes the issue.
I now disabled it and samba works as expected:

Code:
[global]
workgroup = Arbeitsgruppe
server string = Samba Server

# Logging, max 1MB log
log file = /var/log/samba/log.%m
max log size = 1024
log level = 3

interfaces = lo enp3s0

hosts allow = 127.0.0.1 192.168.1.0/24
hosts deny = 0.0.0.0/0

server min protocol = SMB3_11
server max protocol = SMB3_11

security = user

guest ok = no

[homes]
browsable = yes
valid users=%S
writeable = no
create mode = 0600
directory mode = 0700


I did not find a hint in the man pages or somewhere else, why this would happen.
At least for my use case it is solved :D
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 497
Location: San Diego, California USA

PostPosted: Tue Oct 01, 2024 5:43 pm    Post subject: Reply with quote

I think the issue in your original config is that you have the wrong address in the "interfaces" section. In my config I have the actual IP address in the 'interfaces' part. You have a generic .0 address.

Code:
   interfaces = 192.168.1.81/24 127.0.0.1/8
   bind interfaces only = yes


Which matches:
Code:
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether d8:3a:dd:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.81/24 brd 192.168.1.255 scope global dynamic noprefixroute end0
       valid_lft 61571sec preferred_lft 47928sec
Back to top
View user's profile Send private message
Markus09
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2013
Posts: 82

PostPosted: Tue Oct 01, 2024 5:58 pm    Post subject: Reply with quote

I tried your suggestion @gentoo_ram, but it did not work.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum