CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 5 - Server Support
  Logwatch Samba "Forced Election" warnings

 

 Bottom   Previous Topic   Next Topic
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  richard_chapman
      richard_chapman
Logwatch Samba "Forced Election" warnings
#1
Regular Board Member
Joined: 2006/9/8
From
Posts: 246
I have a Centos 5.7 server running Samba with several windows 7 clients in a workgroup. I intend that the Linux box acts as master browser at all times - and mostly it seems to. Every couple of days I get the following error in the Logwatch:"

Forced Election:
In workgroup WORKGROUP when announced server was:
Win7Laptop

It always refers to the same client machine - while there are at least 2 other windows 7 clients on the network - and I can't see any reason why this one behaves differently.. The offending client is a small laptop with wireless connection - but I have at least one other win7 laptop with wireless connection through the same wireless access point.

I also occasionally have long network browsing delays - and I suspect these two problems might be related - so worth investigating.

Thanks

Richard.
Posted on: 2012/2/25 3:30
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Logwatch Samba "Forced Election" warnings
#2
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
I don't know about the setup on the Windows side - wrong forum for that - but what have you set in smb.conf for local master, os level, and preferred master? Better yet, you could show the config file and Samba version.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/2/25 14:45
Create PDF from Post Print
Top
  •  richard_chapman
      richard_chapman
Re: Logwatch Samba "Forced Election" warnings
#3
Regular Board Member
Joined: 2006/9/8
From
Posts: 246
Thanks Phil..
samba version is as standard for up to date centos 5.7 I think... Samba version 3.0.33-3.29.el5_7.4
I do not specify a local master parameter.
preferred master = yes.
os level was set to 33 - but I have increased it to 999 to see whether that makes a difference.
The complete smb.conf is below.

Richard.

# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba,
# read the Samba-HOWTO-Collection. This may be obtained from:
#  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the
# Samba-Guide which is generated daily and can be downloaded from:
#  http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
	log file = /var/log/samba/%m.log
	smb ports = 139
	domain master = yes
	username map = /etc/samba/smbusers
	map to guest = Bad Password
	public = yes
	allow hosts = 192.168. 127.
	wins support = true
	dns proxy = no
	cups options = raw
	netbios name = c5
	server string = Centos 5 Linux
	workgroup = AARDVARKWG
	os level = 999
	preferred master = yes
	max log size = 50
;	load printers = yes
;	netbios name = C5
;	enable privileges = yes
;	encrypt passwords = yes
; The below three settings are important - and might help with intractible share
; problems. See man smb.conf
;	username map = /etc/samba/smbusers
;       security = share
;	guest account = richard
;Below recommended to avoid some syslog errors. Apparently it forces windows
; clients onto this port instead of 445?
;	security = share
;	writeable = yes
;	write list = richard
;	valid users = richard

#added 6/1/2008

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

# server string is the equivalent of the NT Description field

# 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.

# 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

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

# 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

# This option tells cups that the data has already been rasterized

# 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

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

# 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

# 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


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


# 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.

# 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


#============================ Share Definitions ==============================
[homes]
	comment = Home Directories
	browseable = no
	writeable = 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
[printers]
	comment = All Printers
	printable = yes
	path = /var/spool/samba
	public = yes
;; below To get mac printer working???
;;	writeable = yes
;;	valid users = 
;	use client driver = yes
# Set public = yes to allow user 'guest account' to print
# 21/12/2007 added the below lines:
# added 21/12/2007 to get around "access denied" when browsing with windows:


# 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 = yes
;   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



[downloads]
	comment = Downloads in Richard
	writeable = yes
	public = yes
	path = /Share/Datavol/Backups/downloads
;	browseable = yes


[Backups]
	comment = Writeable by all users
	writeable = yes
	public = yes
	create mode = 775
	path = /Share/Datavol/Backups
	directory mode = 775
;	valid users = 

[print$]
	comment = Windows Printer Driver Share
	path = /var/lib/samba/drivers
;;Seem to need this writeable = yes even with the write list below.???
;;	writeable = yes
;;	valid users = 
	public = yes

;	browseable = yes
;	read only = yes

	write list = root, @ntadmin, richard, rhc
;;        admin users = root, @ntadmin, richard, rhc
[Moderator edit: Added code tags to preserve formatting.]
Posted on: 2012/2/27 0:59
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Logwatch Samba "Forced Election" warnings
#4
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
grep -Ev "#|^;" smb.conf | uniq
gives us the active lines:

[global]
	log file = /var/log/samba/%m.log
	smb ports = 139
	domain master = yes
	username map = /etc/samba/smbusers
	map to guest = Bad Password
	public = yes
	allow hosts = 192.168. 127.
	wins support = true
	dns proxy = no
	cups options = raw
	netbios name = c5
	server string = Centos 5 Linux
	workgroup = AARDVARKWG
	os level = 999
	preferred master = yes
	max log size = 50

[homes]
	comment = Home Directories
	browseable = no
	writeable = yes

[printers]
	comment = All Printers
	printable = yes
	path = /var/spool/samba
	public = yes

[downloads]
	comment = Downloads in Richard
	writeable = yes
	public = yes
	path = /Share/Datavol/Backups/downloads

[Backups]
	comment = Writeable by all users
	writeable = yes
	public = yes
	create mode = 775
	path = /Share/Datavol/Backups
	directory mode = 775

[print$]
	comment = Windows Printer Driver Share
	path = /var/lib/samba/drivers
	public = yes
	write list = root, @ntadmin, richard, rhc

The max os level for an 8 bit unsigned int should be 255. Not sure what 999 will give - if it is just masked with 0xFF the result will be 231 which ought to be pretty powerful, but who knows what the real answer is, or what the errant Windows 7 box is using.

For comparison, a default config:
[global]
	workgroup = MYGROUP
	server string = Samba Server Version %v
	log file = /var/log/samba/log.%m
	max log size = 50
	security = user
	passdb backend = tdbsam
	load printers = yes
	cups options = raw

[homes]
	comment = Home Directories
	browseable = no
	writable = yes

[printers]
	comment = All Printers
	path = /var/spool/samba
	browseable = no
	guest ok = no
	writable = no
	printable = yes
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/2/27 1:43
Create PDF from Post Print
Top
  •  richard_chapman
      richard_chapman
Re: Logwatch Samba "Forced Election" warnings
#5
Regular Board Member
Joined: 2006/9/8
From
Posts: 246
OK. Maybe I will make it 127 just to be sure.
Richard.
Posted on: 2012/2/27 2:46
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com