You are not logged in.

#1 2010-05-03 15:02:36

wigren
Member
From: Madison, Indiana
Registered: 2009-05-04
Posts: 12

Samba share shows up only after I restart samba

I've been setting up a laptop with Arch to use at work and home. The problem is I can not see my samba share until I restart the samba service. The server is available though. I can connect with \\IPADDRESS\SHARE. It's just not listed under Network Places or smbtree.

I have samba under DAEMONS  in rc.conf and I've tried starting it in rc.local too. But even if I leave it out of those and start samba manually, I have to restart samba before the share will show up on any client.

The clients are Arch, Windows, and Ubuntu and the share is not available any of them. And the problem happens when I'm at work or at home. I've been googling, but I can't find much about a share being available but not being listed.

My /etc/samba/smb.conf:

#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = MYWORKGOUP

# server string is the equivalent of the NT Description field
   server string = Work Files

# Security mode. Defines in which mode Samba will operate. Possible 
# values are share, user, server, domain and ads. Most people will want 
# user level security. See the Samba-HOWTO-Collection for details.
   security = user

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
   hosts allow = 192.168.0. 192.168.1. 127.

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   load printers = yes

# you may wish to override the location of the printcap file
;   printcap name = /etc/printcap

# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
;   printcap name = lpstat

# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
;   printing = cups

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
;  guest account = pcguest

# this tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/%m.log

# Put a capping on the size of the log files (in Kb).
   max log size = 50

# Use password server option only with security = server
# The argument list may include:
#   password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
#   password server = *
;   password server = <NT-Server-Name>

# Use the realm option only with security = ads
# Specifies the Active Directory realm the host is part of
;   realm = MY_REALM

# Backend to store user information in. New installations should 
# use either tdbsam or ldapsam. smbpasswd is available for backwards 
# compatibility. tdbsam requires no further configuration.
;   passdb backend = tdbsam

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting.
# Note: Consider carefully the location in the configuration file of
#       this line.  The included file is read at that point.
;   include = /usr/local/samba/lib/smb.conf.%m

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
;   interfaces = 192.168.12.2/24 192.168.13.2/24 

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
;   local master = no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
;   os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
;   domain master = yes 

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
;   preferred master = yes

# Enable this if you want Samba to be a domain logon server for 
# Windows95 workstations. 
;   domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
;   logon script = %m.bat
# run a specific logon batch file per username
;   logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
#        %L substitutes for this servers netbios name, %U is username
#        You must uncomment the [Profiles] share below
;   logon path = \\%L\Profiles\%U

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
;   wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
#    Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one    WINS Server on the network. The default is NO.
;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
   dns proxy = no 

# These scripts are used on a domain controller or stand-alone 
# machine to add or delete corresponding unix accounts
;  add user script = /usr/sbin/useradd %u
;  add group script = /usr/sbin/groupadd %g
;  add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
;  delete user script = /usr/sbin/userdel %u
;  delete user from group script = /usr/sbin/deluser %u %g
;  delete group script = /usr/sbin/groupdel %g

# Allow Symlinks (Needed this option after 3.4.6 due to security issues)
unix extensions  = no

#============================ Share Definitions ==============================
;[homes]
;   comment = Home Directories
;   browseable = no
;   writable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/local/samba/lib/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no


# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
;    path = /usr/local/samba/profiles
;    browseable = no
;    guest ok = yes


# NOTE: If you have a BSD-style print system there is no need to 
# specifically define each individual printer
wins support = no
;[printers]
;   comment = All Printers
;   path = /var/spool/samba
;   browseable = no
# Set public = yes to allow user 'guest account' to print
;   guest ok = no
;   writable = no
;   printable = yes

# This one is useful for people to share files
;[tmp]
;   comment = Temporary file space
;   path = /tmp
;   read only = no
;   public = yes

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   writable = no
;   printable = no
;   write list = @staff

# Other examples. 
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
;   comment = Fred's Printer
;   valid users = fred
;   path = /homes/fred
;   printer = freds_printer
;   public = no
;   writable = no
;   printable = yes

# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
;   comment = Fred's Service
;   path = /usr/somewhere/private
;   valid users = fred
;   public = no
;   writable = yes
;   printable = no

# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %U option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
;  comment = PC Directories
;  path = /usr/pc/%m
;  public = no
;  writable = yes

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
;   path = /usr/somewhere/else/public
;   public = yes
;   only guest = yes
;   writable = yes
;   printable = no

# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765

[mike]
comment =  Work Files
path = /home/MYUSER/.samba_share
valid users = MYUSER
available = yes
browsable = yes
public = yes
writable = yes
# Needed this option after 3.4.6 due to security issues
wide links = yes

Offline

#2 2010-05-04 07:35:43

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: Samba share shows up only after I restart samba

have you tried removing the . in the samba_share, it might not make any difference but you can try.

Offline

#3 2010-05-04 11:47:23

wigren
Member
From: Madison, Indiana
Registered: 2009-05-04
Posts: 12

Re: Samba share shows up only after I restart samba

I removed the . (and moved the directory to match) but I still have the same issue.

Here's the smbd.log after a rebooting and then restarting samba:

[2010/05/04 07:25:41.262266,  0] smbd/server.c:500(smbd_open_one_socket)
  smbd_open_once_socket: open_socket_in: Address already in use
[2010/05/04 07:25:41.266578,  0] smbd/server.c:500(smbd_open_one_socket)
  smbd_open_once_socket: open_socket_in: Address already in use
[2010/05/04 07:26:01.041577,  1] smbd/server.c:267(remove_child_pid)
  Scheduled cleanup of brl and lock database after unclean shutdown
[2010/05/04 07:26:21.051370,  1] smbd/server.c:240(cleanup_timeout_fn)
  Cleaning up brl and lock database after unclean shutdown
[2010/05/04 07:26:45.716653,  1] smbd/server.c:267(remove_child_pid)
  Scheduled cleanup of brl and lock database after unclean shutdown
[2010/05/04 07:36:46.016675,  0] smbd/server.c:500(smbd_open_one_socket)
  smbd_open_once_socket: open_socket_in: Address already in use
[2010/05/04 07:36:46.017386,  0] smbd/server.c:500(smbd_open_one_socket)
  smbd_open_once_socket: open_socket_in: Address already in use

And log.nmbd:

[2010/05/04 07:25:41,  0] nmbd/nmbd.c:857(main)
  nmbd version 3.5.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2010/05/04 07:26:48.718046,  0] nmbd/nmbd.c:71(terminate)
  Got SIGTERM: going down...
[2010/05/04 07:27:26,  0] nmbd/nmbd.c:857(main)
  nmbd version 3.5.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2010/05/04 07:27:26.544934,  0] nmbd/nmbd.c:696(open_sockets)
[2010/05/04 07:36:46,  0] nmbd/nmbd.c:857(main)
  nmbd version 3.5.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010

Offline

#4 2010-05-04 19:12:39

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: Samba share shows up only after I restart samba

looks like some other program is already using the port + address, try setting the interfaces option in smb.conf to your specific interface, if it doesnt help, post the smbd.log file after a reboot (when samba doesnt work), and then another one after a samba restart (when samba works).

Last edited by Sin.citadel (2010-05-04 19:13:39)

Offline

#5 2010-05-05 15:26:40

wigren
Member
From: Madison, Indiana
Registered: 2009-05-04
Posts: 12

Re: Samba share shows up only after I restart samba

I added "interfaces = wlan0 192.168.0.10 192.168.1.10" to my smb.conf

Here is the smbd.log after a fresh reboot:

[2010/05/05 11:03:04.236253,  1] smbd/server.c:267(remove_child_pid)
  Scheduled cleanup of brl and lock database after unclean shutdown

And here's log.nmbd:

[2010/05/05 11:03:50,  0] nmbd/nmbd.c:857(main)
  nmbd version 3.5.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2010/05/05 11:03:50.480307,  0] nmbd/nmbd.c:696(open_sockets)

Here they are after restarting samba:
smbd.log:

[2010/05/05 11:21:46.326998,  0] smbd/server.c:500(smbd_open_one_socket)
  smbd_open_once_socket: open_socket_in: Address already in use
[2010/05/05 11:21:46.327854,  0] smbd/server.c:500(smbd_open_one_socket)
  smbd_open_once_socket: open_socket_in: Address already in use

log.nmbd:

[2010/05/05 11:21:46,  0] nmbd/nmbd.c:857(main)
  nmbd version 3.5.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010

Something else I noticed is that if I start samba under DAEMONS and then restart it under rc.local, I still have the same problem. But if I start samba under DAEMONS and then use Wicd's scripts function to restart it, it works.

Offline

#6 2010-05-05 17:31:24

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: Samba share shows up only after I restart samba

it might be that wlan0 comes up a bit late, try setting the interfaces option to point to only the ethernet interface, and then check whether samba works

Offline

#7 2010-05-05 18:37:42

wigren
Member
From: Madison, Indiana
Registered: 2009-05-04
Posts: 12

Re: Samba share shows up only after I restart samba

You mentioned interfaces and it got me thinking. I have a Broadcom 4312 wireless card and I followed the wiki to set it up. I followed this part about the interfaces swapping every time, which was happening to me. But I think setting the devices with udev must be causing the issue with samba. When I remove the udev rules file I created following the wiki, the interfaces swap almost every time, but my samba share shows up the first time!!??

I don't know enough beyond the basics about udev or samba to know why this is happening. So I guess I'll keep the udev rules and restart samba with wicd. That seems to work every time. I'm willing to try other suggestions though. Thank you for your time!

Offline

#8 2010-05-06 06:39:33

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: Samba share shows up only after I restart samba

even if your interfaces are swapping, samba can automatically detect which interface to run based on the ip address, not just the interface name, such as interface 10.0.0.0/24

Offline

#9 2010-08-19 06:46:20

DeletedUser210616
Banned
Registered: 2010-07-07
Posts: 43

Re: Samba share shows up only after I restart samba

i use wicd and have samba in my rc.conf, and i need to restart it also.
This should fix part of your problem tho. https://bbs.archlinux.org/viewtopic.php?id=102731

Offline

Board footer

Powered by FluxBB