Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] CTDB: Failed to connect client socket to daemon.

933 views
Skip to first unread message

steve

unread,
Aug 16, 2014, 9:52:04 AM8/16/14
to
Ubuntu 14.04, ctdb 2.5.3, samba 4.1.11. CTDB is working with IP takeover
between the 2 nodes. The machine is joined to the domain.

Any help with the following errors would be most gratefully received.

1. connect to socket error:
ctdb status
2014/08/16 15:32:03.248034 [23255]: client/ctdb_client.c:267 Failed to
connect client socket to daemon. Errno:Connection refused(111)
common/cmdline.c:156 Failed to connect to daemon
2014/08/16 15:32:03.261221 [23255]: Failed to init ctdb

/etc/default/ctdb
CTDB_NODES=/etc/ctdb/nodes
CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
CTDB_MANAGES_SAMBA=yes
CTDB_SYSLOG=yes
CTDB_DEBUGLEVEL=NOTICE
CTDB_SOCKET=/usr/local/var/run/ctdb/ctdbd.socket


/usr/local/samba/etc/smb.conf
[global]
workgroup = ALTEA
realm = ALTEA.SITE
security = ADS
kerberos method = secrets and keytab
netbios name = SMBCLUSTER
disable netbios = Yes
clustering = Yes
ctdbd socket = /usr/local/var/run/ctdb/ctdbd.socket
[users]
path = /cluster/users
read only = No

**************
/etc/ctdb/50.samba

ps aux|grep ctdbd
root 25902 3.3 3.6 26772 18460 ? SLs 15:38
0:08 /usr/sbin/ctdbd --pidfile=/var/run/ctdb/ctdbd.pid
--nlist=/etc/ctdb/nodes --socket=/usr/local/var/run/ctdb/ctdbd.socket
--public-addresses=/etc/ctdb/public_addresses -d NOTICE --syslog
root 25904 0.0 0.0 3012 396 ? S 15:38
0:00 /usr/sbin/ctdbd --pidfile=/var/run/ctdb/ctdbd.pid
--nlist=/etc/ctdb/nodes --socket=/usr/local/var/run/ctdb/ctdbd.socket
--public-addresses=/etc/ctdb/public_addresses -d NOTICE --syslog
root 26048 0.6 0.1 13404 792 ? S 15:38
0:01 /usr/sbin/ctdbd --pidfile=/var/run/ctdb/ctdbd.pid
--nlist=/etc/ctdb/nodes --socket=/usr/local/var/run/ctdb/ctdbd.socket
--public-addresses=/etc/ctdb/public_addresses -d NOTICE --syslog
**************

2. CTDB does not start smbd but is started correctly (with response from
ctdb) upon:
sudo service smbd start

/etc/ctdb/events.d/50.samba
#!/bin/sh
# ctdb event script for Samba

[ -n "$CTDB_BASE" ] || \
export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")

. $CTDB_BASE/functions

detect_init_style

case $CTDB_INIT_STYLE in
suse)
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmb}
;;
debian)
# CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smbd}
# CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
CTDB_SERVICE_SMB=smbd
;;
*)
# Use redhat style as default:
# CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
# CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
CTDB_SERVICE_SMB=smbd
;;
esac

service_name="smbd"

loadconfig

ctdb_setup_service_state_dir

CTDB_SERVICE_SMB=smbd
service_start ()
{
# make sure samba is not already started
echo $CTDB_SERVICE_SMB
exit 1
service "$CTDB_SERVICE_SMB" stop > /dev/null 2>&1
if [ -n "$CTDB_SERVICE_NMB" ] ; then
service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1
fi
killall -0 -q smbd && {
sleep 1
# make absolutely sure samba is dead
killall -q -9 smbd
}
killall -0 -q nmbd && {
sleep 1
# make absolutely sure samba is dead
killall -q -9 nmbd
}

# start Samba service. Start it reniced, as under very heavy load
# the number of smbd processes will mean that it leaves few cycles
# for anything else
net serverid wipe

if [ -n "$CTDB_SERVICE_NMB" ] ; then
nice_service "$CTDB_SERVICE_NMB" start || die "Failed to start nmbd"
fi

nice_service "$CTDB_SERVICE_SMB" start || die "Failed to start
samba"
}

service_stop ()
{
service "$CTDB_SERVICE_SMB" stop
if [ -n "$CTDB_SERVICE_NMB" ] ; then
service "$CTDB_SERVICE_NMB" stop
fi
}

######################################################################
# Show the testparm output using a cached smb.conf to avoid delays due
# to registry access.

smbconf_cache="$service_state_dir/smb.conf.cache"

testparm_foreground_update ()
{
_timeout="$1"

if ! _out=$(timeout $_timeout testparm -v -s 2>/dev/null) ; then
if [ -f "$smbconf_cache" ] ; then
echo "WARNING: smb.conf cache update failed - using old cache file"
return 1
else
die "ERROR: smb.conf cache create failed"
fi
fi

_tmpfile="${smbconf_cache}.$$"
# Patterns to exclude...
pat='^[[:space:]]+(registry[[:space:]]+shares|include|copy|
winbind[[:space:]]+separator)[[:space:]]+='
echo "$_out" | grep -Ev "$pat" >"$_tmpfile"
mv "$_tmpfile" "$smbconf_cache" # atomic

return 0
}

testparm_background_update ()
{
_timeout="$1"

testparm_foreground_update $_timeout >/dev/null 2>&1 </dev/null &
}

testparm_cat ()
{
testparm -s "$smbconf_cache" "$@" 2>/dev/null
}

list_samba_shares ()
{
testparm_cat |
sed -n -e 's@^[[:space:]]*path[[:space:]]*=[[:space:]]@@p' |
sed -e 's/"//g'
}

list_samba_ports ()
{
testparm_cat --parameter-name="smb ports" |
sed -e 's@,@ @g'
}

###########################

ctdb_start_stop_service

is_ctdb_managed_service || exit 0

###########################

case "$1" in
startup)
ctdb_service_start
;;

shutdown)
ctdb_service_stop
;;

monitor)
testparm_foreground_update 10
ret=$?

smb_ports="$CTDB_SAMBA_CHECK_PORTS"
if [ -z "$smb_ports" ] ; then
smb_ports=$(list_samba_ports)
[ -n "$smb_ports" ] || die "Failed to set smb ports"
fi
ctdb_check_tcp_ports $smb_ports || exit $?

if [ "$CTDB_SAMBA_SKIP_SHARE_CHECK" != "yes" ] ; then
list_samba_shares | ctdb_check_directories || exit $?
fi

if [ $ret -ne 0 ] ; then
testparm_background_update 10
fi
;;

*)
ctdb_standard_event_handler "$@"
;;
esac
exit 0
***************

/etc/init.d/smbd
#!/bin/sh

### BEGIN INIT INFO
# Provides: smbd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Should-Start: slapd cups
# Should-Stop: slapd cups
# Short-Description: start Samba SMB/CIFS daemon (smbd)
### END INIT INFO

PIDDIR=/usr/local/samba/var/run
SMBDPID=$PIDDIR/smbd.pid

# clear conflicting settings from the environment
unset TMPDIR

# See if the daemons are there
test -x /usr/local/samba/sbin/smbd || exit 0

. /lib/lsb/init-functions

case $1 in
start)
if init_is_upstart; then
exit 1
fi
SERVER_ROLE=`samba-tool testparm --parameter-name="server role"
2>/dev/null | tail -1`
if [ "$SERVER_ROLE" = "active directory domain controller" ]; then
exit 0
fi

log_daemon_msg "Starting SMB/CIFS daemon" smbd
# Make sure we have our PIDDIR, even if it's on a tmpfs
install -o root -g root -m 755 -d $PIDDIR

if ! start-stop-daemon --start --quiet --oknodo
--exec /usr/local/samba/sbin/smbd -- -D; then
log_end_msg 1
exit 1
fi

log_end_msg 0
;;
stop)
if init_is_upstart; then
exit 0
fi

log_daemon_msg "Stopping SMB/CIFS daemon" smbd

start-stop-daemon --stop --quiet --pidfile $SMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
then
# Stale PID file, remove it (should be removed by
# smbd itself IMHO).
rm -f $SMBDPID
fi

log_end_msg 0

;;
reload)
log_daemon_msg "Reloading /etc/samba/smb.conf" smbd

start-stop-daemon --stop --quiet --signal HUP --pidfile $SMBDPID

log_end_msg 0
;;
restart|force-reload)
if init_is_upstart; then
exit 1
fi
$0 stop
sleep 1
$0 start
;;
status)
status_of_proc -p $SMBDPID smbd smbd
exit $?
;;
*)
echo "Usage: /etc/init.d/smbd {start|stop|reload|restart|force-reload|
status}"
exit 1
;;
esac

exit 0


--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Achim Gottinger

unread,
Aug 16, 2014, 12:09:44 PM8/16/14
to
Am 16.08.2014 15:52, schrieb steve:
> Ubuntu 14.04, ctdb 2.5.3, samba 4.1.11. CTDB is working with IP takeover
> between the 2 nodes. The machine is joined to the domain.
>
> Any help with the following errors would be most gratefully received.
>
> 1. connect to socket error:
> ctdb status
> 2014/08/16 15:32:03.248034 [23255]: client/ctdb_client.c:267 Failed to
> connect client socket to daemon. Errno:Connection refused(111)
> common/cmdline.c:156 Failed to connect to daemon
What's the output of ls -l /usr/local/var/run/ctdb/ ?
> 2014/08/16 15:32:03.261221 [23255]: Failed to init ctdb
>
> /etc/default/ctdb
> CTDB_NODES=/etc/ctdb/nodes
> CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
> CTDB_MANAGES_SAMBA=yes
> CTDB_SYSLOG=yes
> CTDB_DEBUGLEVEL=NOTICE
> CTDB_SOCKET=/usr/local/var/run/ctdb/ctdbd.socket
>
>
> /usr/local/samba/etc/smb.conf
> [global]
> workgroup = ALTEAfrom /etc/defaults/
Is it intentional to echo "smbd" and exit here?
Id verify maybe with an few echo statements that all the CTDB variables
from /etc/default/ctdb get passed to that script.
Read you copied the samba start script from an wiki can be it assumes
variables in /etc/sysconfig/ctdb.

steve

unread,
Aug 16, 2014, 1:39:48 PM8/16/14
to
On Sat, 2014-08-16 at 18:09 +0200, Achim Gottinger wrote:
> Am 16.08.2014 15:52, schrieb steve:
> > Ubuntu 14.04, ctdb 2.5.3, samba 4.1.11. CTDB is working with IP takeover
> > between the 2 nodes. The machine is joined to the domain.
> >
> > Any help with the following errors would be most gratefully received.
> >
> > 1. connect to socket error:
> > ctdb status
> > 2014/08/16 15:32:03.248034 [23255]: client/ctdb_client.c:267 Failed to
> > connect client socket to daemon. Errno:Connection refused(111)
> > common/cmdline.c:156 Failed to connect to daemon
> What's the output of ls -l /usr/local/var/run/ctdb/ ?
ls -l /usr/local/var/run/ctdb
total 0
srwx------ 1 root root 0 ago 16 19:32 ctdbd.socket

The socket is there and is renewed upon each ctdb (re) start. smb.conf
refers to the same socket.
**comments
> > # CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smbd}
> > # CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
**added
> > CTDB_SERVICE_SMB=smbd
> > ;;
> > *)
> > # Use redhat style as default
**comments
> > # CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
> > # CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
**added
> > CTDB_SERVICE_SMB=smbd
> > ;;
> > esac
> >
** changed samba to smbd
> > service_name="smbd"
> >
> > loadconfig
> >
> > ctdb_setup_service_state_dir
> >
> > CTDB_SERVICE_SMB=smbd
> > service_start ()
> > {
> > # make sure samba is not already started
> > echo $CTDB_SERVICE_SMB
> > exit 1
> Is it intentional to echo "smbd" and exit here?
> Id verify maybe with an few echo statements that all the CTDB variables
> from /etc/default/ctdb get passed to that script.
> Read you copied the samba start script from an wiki can be it assumes
> variables in /etc/sysconfig/ctdb.
>
Hi
The changes we made were necessary for ubuntu. In ubuntu smbd is called
smbd, not either samba or smb.

The script is from the standard Ubuntu ctdb and samba install using
synaptic. Because samba on ubuntu is not built with cluster support, we
built 4.1.11 from source. The script at /etc/init.d/smbd works fine
manually using:
sudo service smbd start
etc. etc.

Cheers,
Steve

Achim Gottinger

unread,
Aug 16, 2014, 1:57:56 PM8/16/14
to
Am 16.08.2014 19:39, schrieb steve:
> On Sat, 2014-08-16 at 18:09 +0200, Achim Gottinger wrote:
>> Am 16.08.2014 15:52, schrieb steve:
>>> Ubuntu 14.04, ctdb 2.5.3, samba 4.1.11. CTDB is working with IP takeover
>>> between the 2 nodes. The machine is joined to the domain.
>>>
>>> Any help with the following errors would be most gratefully received.
>>>
>>> 1. connect to socket error:
>>> ctdb status
>>> 2014/08/16 15:32:03.248034 [23255]: client/ctdb_client.c:267 Failed to
>>> connect client socket to daemon. Errno:Connection refused(111)
>>> common/cmdline.c:156 Failed to connect to daemon
>> What's the output of ls -l /usr/local/var/run/ctdb/ ?
> ls -l /usr/local/var/run/ctdb
> total 0
> srwx------ 1 root root 0 ago 16 19:32 ctdbd.socket
>
> The socket is there and is renewed upon each ctdb (re) start. smb.conf
> refers to the same socket.
Guess that's ok. Maybe the log is more helpfull with CTDB_DEBUGLEVEL=4
(an recommendation i found on an other therad about ctdb issues).
Hi Steve,

I assume ctdb calls /etc/ctdb/events.d/50.samba if it wants to
start/stop samba on the nodes. In case of start this will call the
function service_start().
In your script this function looks like below and it will echo
$CTDB_SERVICE_SMB (in your case smbd) and exit with exit code 1. It
never gets to that last line where it calls /etc/init.d/smbd via
'nice_service "$CTDB_SERVICE_SMB" start'.
On a sidenote you can define CTDB_SERVICE_SMB="smbd" in
/etc/default/ctdb and leave the script unmodified.

service_start ()
{
# make sure samba is not already started
echo $CTDB_SERVICE_SMB
exit 1
service "$CTDB_SERVICE_SMB" stop > /dev/null 2>&1
if [ -n "$CTDB_SERVICE_NMB" ] ; then
service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1
fi
killall -0 -q smbd && {
sleep 1
# make absolutely sure samba is dead
killall -q -9 smbd
}
killall -0 -q nmbd && {
sleep 1
# make absolutely sure samba is dead
killall -q -9 nmbd
}

# start Samba service. Start it reniced, as under very heavy load
# the number of smbd processes will mean that it leaves few cycles
# for anything else
net serverid wipe

if [ -n "$CTDB_SERVICE_NMB" ] ; then
nice_service "$CTDB_SERVICE_NMB" start || die "Failed to start nmbd"
fi

nice_service "$CTDB_SERVICE_SMB" start || die "Failed to start
samba"
}





steve

unread,
Aug 17, 2014, 5:25:31 AM8/17/14
to
On Sat, 2014-08-16 at 19:57 +0200, Achim Gottinger wrote:
> Am 16.08.2014 19:39, schrieb steve:
> > On Sat, 2014-08-16 at 18:09 +0200, Achim Gottinger wrote:
> >> Am 16.08.2014 15:52, schrieb steve:
> >>> Ubuntu 14.04, ctdb 2.5.3, samba 4.1.11. CTDB is working with IP takeover
> >>> between the 2 nodes. The machine is joined to the domain.
> >>>
> >>> Any help with the following errors would be most gratefully received.
> >>>
> >>> 1. connect to socket error:
> >>> ctdb status
> >>> 2014/08/16 15:32:03.248034 [23255]: client/ctdb_client.c:267 Failed to
> >>> connect client socket to daemon. Errno:Connection refused(111)
> >>> common/cmdline.c:156 Failed to connect to daemon
> >> What's the output of ls -l /usr/local/var/run/ctdb/ ?
> > ls -l /usr/local/var/run/ctdb
> > total 0
> > srwx------ 1 root root 0 ago 16 19:32 ctdbd.socket
> >
> > The socket is there and is renewed upon each ctdb (re) start. smb.conf
> > refers to the same socket.
> Guess that's ok. Maybe the log is more helpfull with CTDB_DEBUGLEVEL=4
> (an recommendation i found on an other therad about ctdb issues).

Hi
This solves the socket problem:
/etc/default/ctdb

#CTDB_SOCKET=/usr/local/var/run/ctdb/ctdbd.socket
export CTDB_SOCKET

and indeed:
sudo ctdb status
Number of nodes:2
pnn:0 192.168.0.10 OK (THIS NODE)
pnn:1 192.168.0.11 DISCONNECTED|UNHEALTHY|INACTIVE
Generation:635915504
Size:1
hash:0 lmaster:0
Recovery mode:NORMAL (0)
Recovery master:0

The socket appears at exactly the same place:
ls -l /usr/local/var/run/ctdb
total 0
srwx------ 1 root root 0 ago 17 10:37 ctdbd.socket

so we've left in smb.conf:
ctdbd socket = /usr/local/var/run/ctdb/ctdbd.socket

We've enabled the event:
sudo ctdb enablescript 50.samba

and then tested it:
sudo ctdb eventscript 50.samba
2014/08/17 11:17:17.026342 [15756]: Running eventscripts with arguments
"50.samba" on node 0
2014/08/17 11:17:17.033602 [15756]: Failed to run eventscripts - (null)

sudo ctdb eventscript 50.samba start
2014/08/17 11:18:39.250642 [16159]: Invalid arguments

The log gives:
Aug 17 11:12:01 uc1 ctdbd: server/eventscript.c:765 Starting eventscript
monitor
Aug 17 11:12:01 uc1 ctdbd: server/eventscript.c:388 Eventscript monitor
finished with state 0


What are the valid arguments to 50.samba?

*************
As you suggested we restored the original 50.samba script and added:
CTDB_SERVICE_SMB=smbd
to /etc/defaults/ctdb

Here is /etc/ctdb/events.d/50.samba:
#!/bin/sh
# ctdb event script for Samba

[ -n "$CTDB_BASE" ] || \
export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")

. $CTDB_BASE/functions

detect_init_style

case $CTDB_INIT_STYLE in
suse)
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmb}
;;
debian)
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smbd}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
;;
*)
# Use redhat style as default:
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
;;
esac

service_name="samba"

loadconfig

ctdb_setup_service_state_dir
service_stop ()
{
service "$CTDB_SERVICE_SMB" stop
if [ -n "$CTDB_SERVICE_NMB" ] ; then
service "$CTDB_SERVICE_NMB" stop

Achim Gottinger

unread,
Aug 17, 2014, 8:22:53 AM8/17/14
to
Seen this mentined here.
http://lists.opensuse.org/opensuse-bugs/2013-07/msg03469.html. Assumed
the thread was to old to be relevant here. :-\
>
> and indeed:
> sudo ctdb status
> Number of nodes:2
> pnn:0 192.168.0.10 OK (THIS NODE)
> pnn:1 192.168.0.11 DISCONNECTED|UNHEALTHY|INACTIVE
> Generation:635915504
> Size:1
> hash:0 lmaster:0
> Recovery mode:NORMAL (0)
> Recovery master:0
>
> ...................
>
> What are the valid arguments to 50.samba?
>
> *************
> As you suggested we restored the original 50.samba script and added:
> CTDB_SERVICE_SMB=smbd
> to /etc/defaults/ctdb
>
> Here is /etc/ctdb/events.d/50.samba:
> #!/bin/sh
> # ctdb event script for Samba
>
> [ -n "$CTDB_BASE" ] || \
> export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
>
> . $CTDB_BASE/functions
> .........
> service_start ()
> {
> # make sure samba is not already started
> echo $CTDB_SERVICE_SMB
> exit 1
The above two lines do not appear on debians version of the startscript.
Guess they endedup unintentional.
> service "$CTDB_SERVICE_SMB" stop > /dev/null 2>&1
> if [ -n "$CTDB_SERVICE_NMB" ] ; then
> service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1
> fi
> killall -0 -q smbd && {
> sleep 1
> # make absolutely sure samba is dead
> killall -q -9 smbd
> }
> killall -0 -q nmbd && {
> sleep 1
> # make absolutely sure samba is dead
> killall -q -9 nmbd
> }
>
> # start Samba service. Start it reniced, as under very heavy load
> # the number of smbd processes will mean that it leaves few cycles
> # for anything else
> net serverid wipe
>
> if [ -n "$CTDB_SERVICE_NMB" ] ; then
> nice_service "$CTDB_SERVICE_NMB" start || die "Failed to start
> nmbd"
> fi
>
> nice_service "$CTDB_SERVICE_SMB" start || die "Failed to start
> samba"
> }
>
> .....
> is_ctdb_managed_service || exit 0
Below you can see startup/shutdown/monitor are valid options for the
script. Take an look at /etc/ctdb/functions if you want to inspect the
functions like is_ctdb_managed_service above.
Hope that helps.

Achim Gottinger

unread,
Aug 17, 2014, 9:21:19 AM8/17/14
to
After skimming thru https://ctdb.samba.org/testing.html and "man ctdb" i
guess "ctdb enablescript samba" is what you need to start it and this in
/etc/default/ctdb CTDB_MANAGES_SAMBA="yes"

steve

unread,
Aug 17, 2014, 11:04:26 AM8/17/14
to
OK, removed them.
Hi
smbd won't start:
sudo smbd -i -d3
Maximum core file size limits now 16777216(soft) -1(hard)
smbd version 4.1.11 started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
uid=0 gid=0 euid=0 egid=0
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit
(16384)
params.c:pm_process() - Processing configuration file
"/usr/local/samba/etc/smb.conf"
Processing section "[global]"
connect(/usr/local/var/run/ctdb/ctdbd.socket) failed: Connection refused
messaging_ctdbd_init failed: NT_STATUS_CONNECTION_REFUSED

We have exported CTDB_SOCKET as per the post you sent:
echo $CTDB_SOCKET
/usr/local/var/run/ctdb/ctdbd.socket

But smbd will not start:

sudo smbd -i -d3
Maximum core file size limits now 16777216(soft) -1(hard)
smbd version 4.1.11 started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
uid=0 gid=0 euid=0 egid=0
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit
(16384)
params.c:pm_process() - Processing configuration file
"/usr/local/samba/etc/smb.conf"
Processing section "[global]"
connect(/usr/local/var/run/ctdb/ctdbd.socket) failed: Connection refused
messaging_ctdbd_init failed: NT_STATUS_CONNECTION_REFUSED

We have tried with the socket at:
/var/run/ctdb/ctdbd.socket
and
/usr/local/var/run/ctdb/ctdbd.socket

We can only run:
sudo ctdb status
with the socket at:
/usr/local/var/run/ctdb/ctdbd.socket

But then, smbd will not start.

Give up?
Thanks for your patience,
Steve

Achim Gottinger

unread,
Aug 17, 2014, 12:18:18 PM8/17/14
to
Did an quick setup here on my testing vm (debian wheezy with samba from
backports.
CTDB_SOCKET is not configured in /etc/default/ctdb here, i did not
change that.
I created suitable /etc/ctdb/nodes and /etc/ctdb/public_addresses for my
network and set CTDB_RECOVERY_LOCK=/tmp/ctdb.lock in /etc/default/ctdb.

First try to start ctdb resulted in an error message
2014/08/17 17:27:46.970998 [16882]: Unable to bind on ctdb socket
'/var/lib/run/ctdb/ctdbd.socket'

So the lock seems to be expected at /var/lib/run/ctdb. The folder did
not exist so i created it. Then ctdb started.

ls -l /var/lib/run/ctdb/
total 0
srwx------ 1 root root 0 Aug 17 17:52 ctdbd.socket

ctdb status
Number of nodes:1
pnn:0 192.168.100.104 OK (THIS NODE)
Generation:1546680508
Size:1
hash:0 lmaster:0
Recovery mode:NORMAL (0)
Recovery master:0

Stripped down my smb.conf which is usually for an addc to this content:

[global]
workgroup = DOMAIN
realm = domain.local
netbios name = server
interfaces = 192.168.100.104,127.0.0.1
bind interfaces only = Yes
disable netbios = yes
clustering = yes
ctdbd socket = /var/lib/run/ctdb/ctdbd.socket

[s1]
path = /test/data/s1
read only = No

Trying to start smbd in foreground just like you did:

~#smbd -i -d3
Maximum core file size limits now 16777216(soft) -1(hard)
smbd version 4.1.9-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
uid=0 gid=0 euid=0 egid=0
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
Processing section "[s1]"
adding IPC service
added interface eth0 ip=192.168.100.104 bcast=192.168.100.255
netmask=255.255.255.0
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
loaded services
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'secrets.tdb' with dbid 0x7132c184
db_open_ctdb: opened database 'dbwrap_watchers.tdb' with dbid 0x6afb8c09
db_open_ctdb: opened database 'smbXsrv_version_global.tdb' with dbid
0x521b7544
db_open_ctdb: opened database 'serverid.tdb' with dbid 0x9ec2a880
db_open_ctdb: opened database 'smbXsrv_session_global.tdb' with dbid
0x6b06a26d
db_open_ctdb: opened database 'smbXsrv_tcon_global.tdb' with dbid 0x68c12c2c
db_open_ctdb: opened database 'brlock.tdb' with dbid 0x4e66c2b2
db_open_ctdb: opened database 'locking.tdb' with dbid 0x7a19d84d
db_open_ctdb: opened database 'notify_index.tdb' with dbid 0xaf029e9d
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'share_info.tdb' with dbid 0xc3078fba
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'group_mapping.tdb' with dbid 0xa1413774
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'account_policy.tdb' with dbid 0x2ca251cf
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'passdb.tdb' with dbid 0x3ef19640
db_open_ctdb: opened database 'smbXsrv_open_global.tdb' with dbid 0x66f71b8c
Initialise the svcctl registry keys if needed.
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
Initialise the eventlog registry keys if needed.
db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
db_open_ctdb: opened database 'printer_list.tdb' with dbid 0x5bcfcbd7
reloading printcap cache

Seems it's ok for ctdb.

An quick test to check the socket used by ctdbd.

~#pidof ctdbd
22724 22580

~#lsof -p 22580 | grep socket
ctdbd 22580 root 5u unix 0xffff880002319ac0 0t0 609955
/var/lib/run/ctdb/ctdbd.socket
ctdbd 22580 root 16u unix 0xffff8800ec5103c0 0t0 616499
/var/lib/run/ctdb/ctdbd.socket

Achim Gottinger

unread,
Aug 17, 2014, 1:51:38 PM8/17/14
to
Post this list of configure options used by debian samba 4.1.9 for
comparison.

--prefix=/usr \
--enable-fhs \
--sysconfdir=/etc \
--localstatedir=/var \
--with-privatedir=/var/lib/samba/private \
--with-smbpasswd-file=/etc/samba/smbpasswd \
--with-piddir=/var/run/samba \
--with-pammodulesdir=/lib/$(DEB_HOST_MULTIARCH)/security \
--with-pam \
--with-syslog \
--with-utmp \
--with-pam_smbpass \
--with-winbind \
--with-shared-modules=idmap_rid,idmap_ad,idmap_adex,idmap_hash,idmap_ldap,idmap_tdb2,vfs_dfs_samba4,auth_samba4
\
--with-automount \
--with-ldap \
--with-ads \
--with-dnsupdate \
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
--with-modulesdir=/usr/lib/$(DEB_HOST_MULTIARCH)/samba \
--datadir=/usr/share \
--with-lockdir=/var/run/samba \
--with-statedir=/var/lib/samba \
--with-cachedir=/var/cache/samba \
--disable-avahi \
--with-ctdb=/usr --with-cluster-support \
--disable-rpath \
--disable-rpath-install \
--bundled-libraries=NONE,pytevent,iniparser \
--builtin-libraries=replace,ccan \
--minimum-library-version="$(shell ./debian/autodeps.py
--minimum-library-version)"

steve

unread,
Aug 18, 2014, 4:38:40 AM8/18/14
to
Hi
Thanks for this. We rolled back to ctdb 2.5.1 and the sockets are
working in the same place as your debian install. We can join the
domain, smbd fires up _manually_ and we can server windows and linux
domain clients:
sudo ctdb status
Number of nodes:2
pnn:0 192.168.0.10 OK (THIS NODE)
pnn:1 192.168.0.11 DISCONNECTED|UNHEALTHY|INACTIVE
Generation:1016391403
Size:1
hash:0 lmaster:0
Recovery mode:NORMAL (0)
Recovery master:0

BUT:
the 50.samba script does not work:
sudo ctdb enablescript 50.samba

sudo ctdb eventscript 50.samba startup
2014/08/18 10:09:20.129066 [18449]: Invalid arguments

sudo ctdb eventscript 50.samba shutdown
2014/08/18 10:10:51.002979 [19033]: Invalid arguments

even though ctdb says it has:
Aug 18 10:19:05 uc1 ctdbd: server/eventscript.c:496 Eventscript monitor
finished with state 0

/etc/ctdb/events.d/50.samba
#!/bin/sh
# ctdb event script for Samba

[ -n "$CTDB_BASE" ] || \
export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")

. $CTDB_BASE/functions

detect_init_style

case $CTDB_INIT_STYLE in
suse)
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmb}
;;
debian)
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smbd}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
;;
*)
# Use redhat style as default:
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
;;
esac

service_name="smbd"

loadconfig

ctdb_setup_service_state_dir

service_start ()
{
# make sure samba is not already started
service "$CTDB_SERVICE_SMB" stop > /dev/null 2>&1
if [ -n "$CTDB_SERVICE_NMB" ] ; then
service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1
fi
killall -0 -q smbd && {
sleep 1
# make absolutely sure samba is dead
killall -q -9 smbd
}
killall -0 -q nmbd && {
sleep 1
# make absolutely sure samba is dead
killall -q -9 nmbd
}

# start Samba service. Start it reniced, as under very heavy load
# the number of smbd processes will mean that it leaves few cycles
# for anything else
net serverid wipe

if [ -n "$CTDB_SERVICE_NMB" ] ; then
nice_service "$CTDB_SERVICE_NMB" start || die "Failed to start nmbd"
fi

nice_service "$CTDB_SERVICE_SMB" start || die "Failed to start
samba"
}

service_stop ()
{
service "$CTDB_SERVICE_SMB" stop
if [ -n "$CTDB_SERVICE_NMB" ] ; then
service "$CTDB_SERVICE_NMB" stop

Achim Gottinger

unread,
Aug 18, 2014, 6:32:15 AM8/18/14
to
Am 18.08.2014 12:09, schrieb steve:
> On Mon, 2014-08-18 at 11:31 +0200, Achim Gottinger wrote:
>> Change service_name back to samba it
>> Is Usedom by ctdb
> OK. Thanks again. Getting closer. Changed smbd to samba:
> sudo ctdb eventscript 50.samba startup
> 2014/08/18 11:57:16.958275 [ 9029]: Invalid arguments
First sorry for the typos, iphone autocorrection got me.

I assue you want to give ctdbd control over samba.
https://ctdb.samba.org/samba.html

Do you have CTDB_MANAGES_SAMBA="yes" in /etc/default/ctdb?

If so ctdb calls /etc/ctdb/event.d/50.samba. Are you sure you do not
have exit 1 iin the service_start function any longer?

Seen you enabled the script with

ctdb enablescript samba

I guess you can trigger an start with:

ctdb -n 0 disable
ctdb -n 0 enable

And

ctdb scriptstatus

should show if samba is up and running under ctdb control.


>
> log:
> Aug 18 11:52:05 uc1 ctdbd: Starting traverse on DB serverid.tdb (id 589)
> Aug 18 11:52:06 uc1 ctdbd: Ending traverse on DB serverid.tdb (id 589),
> records 0
> Aug 18 11:52:06 uc1 ctdbd: Local traverse end db:serverid.tdb reqid:589
> records:0
> Aug 18 11:52:06 uc1 ctdbd: 50.samba: Failed to start samba
> Aug 18 11:52:06 uc1 ctdbd: server/eventscript.c:496 Eventscript startup
> finished with state 1
> Aug 18 11:52:06 uc1 ctdbd: startup event failed
>
> smbd starts fine via the script:
> sudo service smbd start:
> ps aux|grep smbd
> root 11476 6.0 1.7 60904 8968 ? Ss 12:00 0:00 smbd -F
> root 11491 2.5 0.6 60904 3348 ? S 12:00 0:00 smbd -F
>
> but not via smbd -i -d3:
> which smbd
> /usr/local/samba/sbin/smbd
>
> sometimes we get this;
> sudo smbd -i -d3
> Maximum core file size limits now 16777216(soft) -1(hard)
> smbd version 4.1.11 started.
> Copyright Andrew Tridgell and the Samba Team 1992-2013
> uid=0 gid=0 euid=0 egid=0
> lp_load_ex: refreshing parameters
> Initialising global parameters
> rlimit_max: increasing rlimit_max (1024) to minimum Windows limit
> (16384)
> params.c:pm_process() - Processing configuration file
> "/usr/local/samba/etc/smb.conf"
> Processing section "[global]"
> Registered MSG_REQ_POOL_USAGE
> Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
> lp_load_ex: refreshing parameters
> Initialising global parameters
> rlimit_max: increasing rlimit_max (1024) to minimum Windows limit
> (16384)
> params.c:pm_process() - Processing configuration file
> "/usr/local/samba/etc/smb.conf"
> Processing section "[global]"
> Processing section "[users]"
> Processing section "[profiles]"
> Processing section "[shared]"
> adding IPC service
> added interface eth1 ip=192.168.0.10 bcast=192.168.0.255
> netmask=255.255.255.0
> added interface bond0 ip=192.168.1.82 bcast=192.168.1.255
> netmask=255.255.255.0
> loaded services
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'secrets.tdb' with dbid 0x7132c184
> db_open_ctdb: opened database 'dbwrap_watchers.tdb' with dbid 0x6afb8c09
> db_open_ctdb: opened database 'smbXsrv_version_global.tdb' with dbid
> 0x521b7544
> db_open_ctdb: opened database 'serverid.tdb' with dbid 0x9ec2a880
> db_open_ctdb: opened database 'smbXsrv_session_global.tdb' with dbid
> 0x6b06a26d
> db_open_ctdb: opened database 'smbXsrv_tcon_global.tdb' with dbid
> 0x68c12c2c
> db_open_ctdb: opened database 'brlock.tdb' with dbid 0x4e66c2b2
> db_open_ctdb: opened database 'locking.tdb' with dbid 0x7a19d84d
> db_open_ctdb: opened database 'notify_index.tdb' with dbid 0xaf029e9d
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'share_info.tdb' with dbid 0xc3078fba
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'passdb.tdb' with dbid 0x3ef19640
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'group_mapping.tdb' with dbid 0xa1413774
> idmap range not specified for domain '*'
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'account_policy.tdb' with dbid 0x2ca251cf
> db_open_ctdb: opened database 'smbXsrv_open_global.tdb' with dbid
> 0x66f71b8c
> Initialise the svcctl registry keys if needed.
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
> Initialise the eventlog registry keys if needed.
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
> db_open_ctdb: opened database 'printer_list.tdb' with dbid 0x5bcfcbd7
> get_dc_list: preferred server list: "palmera.altea.site, *"
> Successfully contacted LDAP server 192.168.1.132
> get_dc_list: preferred server list: "palmera.altea.site, *"
> get_dc_list: preferred server list: "palmera.altea.site, *"
> Successfully contacted LDAP server 192.168.1.132
> Connected to LDAP server palmera.altea.site
> ads_sasl_spnego_bind: got OID=1.2.840.48018.1.2.2
> ads_sasl_spnego_bind: got OID=1.2.840.113554.1.2.2
> ads_sasl_spnego_bind: got OID=1.3.6.1.4.1.311.2.2.10
> ads_sasl_spnego_bind: got server principal name =
> not_defined_in_RFC4178@please_ignore
> ads_krb5_mk_req: krb5_cc_get_principal failed (No such file or
> directory)
> ads_cleanup_expired_creds: Ticket in ccache[MEMORY:prtpub_cache]
> expiration lun, 18 ago 2014 22:02:15 CEST
> reloading printcap cache
> reload status: ok
> reloading printcap cache
> cups_pcap_load_async: already waiting for a refresh event
> reload status: error
> waiting for connections
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
> db_open_ctdb: opened database 'g_lock.tdb' with dbid 0x4d2a432b
> db_open_ctdb: opened database 'registry.tdb' with dbid 0x6cf2837d
> Could not find child 12518 -- ignoring
>
> . . . and we are returned to the prompt.
>
> At other times we get this:
> /etc/samba/smb.conf is a link to /usr/local/samba/etc/smbd
>
> sudo samba -i -d3
> lpcfg_load: refreshing parameters from /etc/samba/smb.conf
> params.c:pm_process() - Processing configuration file
> "/etc/samba/smb.conf"
> Processing section "[global]"
> Processing section "[users]"
> Processing section "[profiles]"
> Processing section "[shared]"
> pm_process() returned Yes
> samba version 4.1.6-Ubuntu started.
> Copyright Andrew Tridgell and the Samba Team 1992-2013
> GENSEC backend 'gssapi_spnego' registered
> GENSEC backend 'gssapi_krb5' registered
> GENSEC backend 'gssapi_krb5_sasl' registered
> GENSEC backend 'schannel' registered
> GENSEC backend 'spnego' registered
> GENSEC backend 'ntlmssp' registered
> GENSEC backend 'krb5' registered
> GENSEC backend 'fake_gssapi_krb5' registered
> NTPTR backend 'simple_ldb'
> NTVFS backend 'default' for type 1 registered
> NTVFS backend 'posix' for type 1 registered
> NTVFS backend 'unixuid' for type 1 registered
> NTVFS backend 'unixuid' for type 3 registered
> NTVFS backend 'unixuid' for type 2 registered
> NTVFS backend 'cifs' for type 1 registered
> NTVFS backend 'smb2' for type 1 registered
> NTVFS backend 'simple' for type 1 registered
> NTVFS backend 'cifsposix' for type 1 registered
> NTVFS backend 'default' for type 3 registered
> NTVFS backend 'default' for type 2 registered
> NTVFS backend 'nbench' for type 1 registered
> PROCESS_MODEL 'single' registered
> PROCESS_MODEL 'onefork' registered
> PROCESS_MODEL 'prefork' registered
> PROCESS_MODEL 'standard' registered
> AUTH backend 'sam' registered
> AUTH backend 'sam_ignoredomain' registered
> AUTH backend 'anonymous' registered
> AUTH backend 'winbind' registered
> AUTH backend 'winbind_wbclient' registered
> AUTH backend 'name_to_ntstatus' registered
> AUTH backend 'unix' registered
> SHARE backend [classic] registered.
> At this time the 'samba' binary should only be used for either:
> 'server role = active directory domain controller' or to access the
> ntvfs file server with 'server services = +smb' or the rpc proxy with
> 'dcerpc endpoint servers = remote'
> You should start smbd/nmbd/winbindd instead for domain member and
> standalone file server tasks
>
This is differnet because you call smbd and sometimes samba. :-)

steve

unread,
Aug 18, 2014, 8:38:58 AM8/18/14
to
On Mon, 2014-08-18 at 12:32 +0200, Achim Gottinger wrote:
> Am 18.08.2014 12:09, schrieb steve:
> > On Mon, 2014-08-18 at 11:31 +0200, Achim Gottinger wrote:
> >> Change service_name back to samba it
> >> Is Usedom by ctdb
> > OK. Thanks again. Getting closer. Changed smbd to samba:
> > sudo ctdb eventscript 50.samba startup
> > 2014/08/18 11:57:16.958275 [ 9029]: Invalid arguments
> First sorry for the typos, iphone autocorrection got me.
No problem. Thanks for your time and trouble.
>
> I assue you want to give ctdbd control over samba.
> https://ctdb/samba.org/samba.html
Yes.
ATM, we have both nodes live. But evidently that's very bad. We must
have only one node up at a time it seems.

>
> Do you have CTDB_MANAGES_SAMBA="yes" in /etc/default/ctdb?
Yes:
/etc/default/ctdb

CTDB_NODES=/etc/ctdb/nodes
CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
CTDB_MANAGES_SAMBA=yes
CTDB_SYSLOG=yes
CTDB_DEBUGLEVEL=3
CTDB_SERVICE_SMB=smbd

>
> If so ctdb calls /etc/ctdb/event.d/50.samba. Are you sure you do not
> have exit 1 iin the service_start function any longer?
>
> Seen you enabled the script with
>
> ctdb enablescript samba
It was:
sudo ctdb enablescript 50.samba

>
> I guess you can trigger an start with:
>
> ctdb -n 0 disable
> ctdb -n 0 enable
done.
>
> And
>
> ctdb scriptstatus
gives us:
sudo ctdb scriptstatus
monitor cycle never run
>
> should show if samba is up and running under ctdb control.
but:
sudo ctdb eventscript 50.samba startup
2014/08/18 14:33:41.263631 [12631]: Invalid arguments

here is /etc/ctdb/events.d/50.samba
#!/bin/sh
# ctdb event script for Samba

[ -n "$CTDB_BASE" ] || \
export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")

. $CTDB_BASE/functions

detect_init_style

case $CTDB_INIT_STYLE in
suse)
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmb}
;;
debian)
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smbd}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
;;
*)
# Use redhat style as default:
CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smb}
CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
;;
esac

service_name="samba"
> You should start smbd/nmbd/winbindd instead for domain member and
> > standalone file server tasks
> >
> This is differnet because you call smbd and sometimes samba. :-)
>
Yes. Sorry. Stupid of us!

steve

unread,
Aug 18, 2014, 9:19:55 AM8/18/14
to
##############################################
OK, we simplified the start and stop part of 50.samba to:
service_start ()
{
service smbd start
}
service_stop ()
{
sudo service smbd stop
}

And the log changes to:
Aug 18 15:09:06 uc1 ctdbd: 50.samba: ERROR: samba tcp port 445 is not
responding
Aug 18 15:09:06 uc1 ctdbd: server/eventscript.c:496 Eventscript monitor
finished with state 1

netstat shows nothing on 445 nor 139

We can however start samba manually, whereupon the 445 error disappears.
Presumably because then it _is_ responding?

Still, if smbd is not up at the beginning, ctdb will not start it.
Are we any closer?

Achim Gottinger

unread,
Aug 18, 2014, 9:39:57 AM8/18/14
to
The sytax to start ctdb managed services is

ctdb eventscrip startup

or to stop em

ctdb eventscript shutdown

I also get these "samba tcp port 445 is not responding" messages if i
shutdown eventscripts but they disappear after a few seconds.

ctdb scriptstatus
19 scripts were executed last monitor cycle
00.ctdb Status:OK Duration:0.017 Mon Aug 18 15:39:05 2014
01.reclock Status:OK Duration:0.038 Mon Aug 18 15:39:05 2014
10.interface Status:OK Duration:0.066 Mon Aug 18 15:39:05 2014
11.natgw Status:OK Duration:0.013 Mon Aug 18 15:39:05 2014
11.routing Status:OK Duration:0.013 Mon Aug 18 15:39:05 2014
13.per_ip_routing Status:OK Duration:0.013 Mon Aug 18 15:39:05 2014
20.multipathd Status:DISABLED
31.clamd Status:DISABLED
40.fs_use Status:DISABLED
40.vsftpd Status:OK Duration:0.013 Mon Aug 18 15:39:05 2014
41.httpd Status:OK Duration:0.013 Mon Aug 18 15:39:05 2014
49.winbind Status:OK Duration:0.017 Mon Aug 18 15:39:05 2014
50.samba Status:OK Duration:0.147 Mon Aug 18 15:39:05 2014
60.ganesha Status:DISABLED
60.nfs Status:OK Duration:0.017 Mon Aug 18 15:39:05 2014
62.cnfs Status:OK Duration:0.017 Mon Aug 18 15:39:05 2014
70.iscsi Status:OK Duration:0.013 Mon Aug 18 15:39:05 2014
91.lvs Status:OK Duration:0.013 Mon Aug 18 15:39:05 2014
99.timeout Status:DISABLED

steve

unread,
Aug 18, 2014, 10:59:55 AM8/18/14
to
Hi
And does smbd get started?

Here, it still doesn't:
sudo ctdb eventscript startup
2014/08/18 16:37:51.329851 [ 5327]: Running eventscripts with arguments
"startup" on node 0

sudo ctdb scriptstatus
13 scripts were executed last monitor cycle
00.ctdb Status:OK Duration:0.142 Mon Aug 18 16:37:55
2014
01.reclock Status:OK Duration:0.109 Mon Aug 18 16:37:56
2014
10.interface Status:OK Duration:0.442 Mon Aug 18 16:37:56
2014
11.routing Status:OK Duration:0.062 Mon Aug 18 16:37:56
2014
11.natgw Status:OK Duration:0.054 Mon Aug 18 16:37:56
2014
13.per_ip_routing Status:OK Duration:0.058 Mon Aug 18 16:37:56
2014
20.multipathd Status:DISABLED
31.clamd Status:DISABLED
40.vsftpd Status:OK Duration:0.058 Mon Aug 18 16:37:56
2014
40.fs_use Status:DISABLED
41.httpd Status:OK Duration:0.056 Mon Aug 18 16:37:56
2014
49.winbind Status:DISABLED
50.samba Status:ERROR Duration:0.604 Mon Aug 18 16:37:56
2014
OUTPUT:ERROR: samba tcp port 445 is not responding

Still getting the 445 error. This is with the original 50.samba without
our simplifications, but the same with the simplifications.

Disabling the eventscript makes no difference to the 445 error:

Aug 18 16:54:47 uc1 ctdbd: server/eventscript.c:859 Starting eventscript
shutdown
Aug 18 16:54:48 uc1 ctdbd: server/eventscript.c:496 Eventscript shutdown
finished with state 0
Aug 18 16:54:48 uc1 ctdbd: Monitoring has been enabled

Is there any way we could ignore the 445 error and go ahead anyway?

Once we start smbd manually, the error disappears. It just won't start
to begin with.

Achim Gottinger

unread,
Aug 18, 2014, 3:44:33 PM8/18/14
to
If you take an look at the 50.samba script

.................................

list_samba_ports ()
{
testparm_cat --parameter-name="smb ports" |
sed -e 's@,@ @g'
}

.................................

monitor)
testparm_foreground_update 10
ret=$?

smb_ports="$CTDB_SAMBA_CHECK_PORTS"
if [ -z "$smb_ports" ] ; then
smb_ports=$(list_samba_ports)
[ -n "$smb_ports" ] || die "Failed to set smb ports"
fi
ctdb_check_tcp_ports $smb_ports || exit $?

if [ "$CTDB_SAMBA_SKIP_SHARE_CHECK" != "yes" ] ; then
list_samba_shares | ctdb_check_directories || exit $?
fi

if [ $ret -ne 0 ] ; then
testparm_background_update 10
fi
;;



there is an check for these tcp ports

testparm -v --parameter-name="smb ports"

On my side these are 139 and 445. In my test environment samba starts
and stops fine via ctdb and it does listen on port 445.
It does not allow me to access the server from an client because i just
disabled all addc stuff and did not enable any password mechanisms.

Seems you have an kerberos problem on your machine because i found this
in your smbd -i -d3 logs. I'd increase the loglevel in smb.conf restart
via ctdb and if it's not an easy fix use an simpler password backend first.

ads_krb5_mk_req: krb5_cc_get_principal failed (No such file or
directory)
ads_cleanup_expired_creds: Ticket in ccache[MEMORY:prtpub_cache]




steve

unread,
Aug 19, 2014, 4:35:31 AM8/19/14
to
On Mon, 2014-08-18 at 21:44 +0200, Achim Gottinger wrote:
Hi
We can't reproduce that I'm afraid. As we have this working out of the
box (or as close you can get with ctdb out of the box) with openSUSE,
we're gonna have to go with that. Just to say thanks for your time. We
really did want to go with Ubuntu but. . .
Cheers,
Steve

Rowland Penny

unread,
Aug 19, 2014, 5:03:31 AM8/19/14
to
Hi Steve,
You could always try Ubuntu's father ;-) Debian Wheezy with samba 4.1.9
& ctdb 2.5.3 from backports.

Rowland

Achim Gottinger

unread,
Aug 19, 2014, 6:14:12 AM8/19/14
to
I see it became an lengthy project. I filed an bug report for debians
ctdb package about the odd socket standard path /var/lib/run/ctdb
instead of /var/run/ctdb meanwhile.

steve

unread,
Aug 19, 2014, 6:14:28 AM8/19/14
to
On Tue, 2014-08-19 at 10:03 +0100, Rowland Penny wrote:
> On 19/08/14 09:35, steve wrote:
> Hi Steve,
> You could always try Ubuntu's father ;-) Debian Wheezy with samba 4.1.9
> & ctdb 2.5.3 from backports.
>
> Rowland
>
Hi Rowland. Thanks. 1. It's political I'm afraid and 2. we've run out of
testing time. We moved from sles to openSUSE. That was hard enough. We
have to prove that Ubuntu is now the way to go. So, as you can see,
we've just shot ourselves in the proverbial. . .

steve

unread,
Aug 19, 2014, 6:19:07 AM8/19/14
to
On Tue, 2014-08-19 at 12:14 +0200, Achim Gottinger wrote:
> Am 19.08.2014 10:35, schrieb steve:
> I see it became an lengthy project. I filed an bug report for debians
> ctdb package about the odd socket standard path /var/lib/run/ctdb
> instead of /var/run/ctdb meanwhile.
>
>
Thank you for that and also your patience with us. We were trying to
show that Ubuntu was the way to go. But with Ubuntu samba being shipped
without cluster support and the ctdb mess we were just laughed out of
hand:(
0 new messages