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

steve steve at steve-ss.com
Sun Aug 17 09:04:26 MDT 2014


On Sun, 2014-08-17 at 14:22 +0200, Achim Gottinger wrote:
> Am 17.08.2014 11:25, schrieb steve:
> > 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
> 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.
OK, removed them.

> >      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.
> > ###########################
> >
> > 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
> >
> Hope that helps.

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





More information about the samba mailing list