CTDB port is not aware of Ubuntu-specific NFS Settings

Bug #722201 reported by Kirill Peskov on 2011-02-20
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ctdb (Debian)
New
Undecided
Unassigned
ctdb (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: ctdb

CTDB suppose to detect distro-specific Samba/NFS/Apache settings, or at least provide the way to manual tweaking/config of ctdb. In the current state looks like ctdb has been ported from RH-based distribution and its partially aware of some Debian-specific settings/files/scripts locations, but completely unaware of Ubuntu. For examle: ctdb is able to control NFS daemons, but it never looks for /etc/init.d/nfs-kernel-server for startup or /etc/default/nfs-kernel-server for settings.

1) Found on Ubuntu 10.04
2) CTDB version: 1.0.108-3ubuntu3
3) Expected: ability of ctdb to control nfs-kernel-server
4) Happened: without significant ctdb script changes (adding sections, aware of ubuntu-specific nfs- and samba- config- and startup scripts locations) ctdb is not able to function properly

Mathieu Parent (math-parent) wrote :

Can you propose a patch?

Eric G (erickg) wrote :

This seems to be impacting me on 14.04 as well. I am only trying to use CTDB with Samba:

/var/log/ctdb/log.ctdb:

2014/12/19 10:42:23.770789 [ 1077]: startup event failed
2014/12/19 10:42:28.771410 [ 1077]: Recoveries finished. Running the "startup" event.
2014/12/19 10:42:28.891893 [ 1077]: 50.samba: Failed to start samba
2014/12/19 10:42:28.892134 [ 1077]: startup event failed
2014/12/19 10:42:33.893168 [ 1077]: Recoveries finished. Running the "startup" event.
2014/12/19 10:42:34.205463 [ 1077]: 50.samba: Failed to start samba
2014/12/19 10:42:34.205666 [ 1077]: startup event failed
2014/12/19 10:42:39.206372 [ 1077]: Recoveries finished. Running the "startup" event.
2014/12/19 10:42:39.573180 [ 1077]: 50.samba: Failed to start samba
2014/12/19 10:42:39.573395 [ 1077]: startup event failed

root@san1:/etc/ctdb# ctdb status
Number of nodes:2
pnn:0 10.10.1.21 UNHEALTHY (THIS NODE)
pnn:1 10.10.1.22 UNHEALTHY
Generation:1291295798
Size:2
hash:0 lmaster:0
hash:1 lmaster:1
Recovery mode:NORMAL (0)
Recovery master:1

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ctdb (Ubuntu):
status: New → Confirmed
Eric G (erickg) wrote :

I was able to make some tweaks and get it running for Samba. Looks like these could also apply to upstream Debian.

The service command is in a different path:

root@san1:/etc/ctdb# diff -u functions functions.orig
--- functions 2014-12-19 11:24:12.660339600 -0500
+++ functions.orig 2014-12-19 10:53:29.247030923 -0500
@@ -161,8 +161,6 @@

   if [ -x /sbin/service ]; then
       $_nice /sbin/service "$_service_name" "$_op"
- elif [ -x /usr/sbin/service ]; then
- $_nice /usr/sbin/service "$_service_name" "$_op"
   elif [ -x $CTDB_ETCDIR/init.d/$_service_name ]; then
       $_nice $CTDB_ETCDIR/init.d/$_service_name "$_op"
   elif [ -x $CTDB_ETCDIR/rc.d/init.d/$_service_name ]; then

This might actually be a problem with the samba init script, but smbd and nmbd seem to be controled by upstart and the scripts in /etc/init.d don't actually do anything. Maybe /etc/init.d/samba is being phased out and the services are managed directly, which seems to work here:

root@san1:/etc/ctdb/events.d# diff -u 50.samba ~/50.samba.orig
--- 50.samba 2014-12-19 11:22:05.522193976 -0500
+++ /root/50.samba.orig 2014-12-19 11:21:46.602468765 -0500
@@ -14,8 +14,8 @@
   CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmb}
   ;;
  debian)
- CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smbd}
- CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmbd}
+ CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-samba}
+ CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
   ;;
  *)
   # Use redhat style as default:

root@san1:/etc/ctdb/events.d# ctdb status
Number of nodes:2
pnn:0 10.10.1.21 OK (THIS NODE)
pnn:1 10.10.1.22 UNHEALTHY
Generation:330683100
Size:2
hash:0 lmaster:0
hash:1 lmaster:1
Recovery mode:NORMAL (0)
Recovery master:1

Eric G (erickg) wrote :

There is a related Samba bug #1321369 open to address the second patch I attached. It seems that my patch is probably the preferred fix for now as /etc/init.d/samba is still buggy.

https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1321369

Robert Sander (gurubert) wrote :

This patch makes nfs-kernel-server work with ctdb.

It rewrites the code to use /etc/default/nfs-kernel-server and the correct systemd service.

As the is a unit nfs-mountd.service that gets started from nfs-kernel-server.service as requirement and this unit only uses $RPCMOUNTDARGS the setting in /etc/default/nfs-kernel-server should be

 # MOUNTD_PORT=597
 RPCMOUNTDOPTS="-p 597"

The attachment "patch for Ubuntu 17.10" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Robert Sander (gurubert) wrote :

Additionally it is necessary to create a file /etc/modprobe.d/lockd.conf with this content:

 # Set the TCP port that the NFS lock manager should use.
 # port must be a valid TCP port value (1-65535).
 options lockd nlm_tcpport=599

 # Set the UDP port that the NFS lock manager should use.
 # port must be a valid UDP port value (1-65535).
 options lockd nlm_udpport=599

Lockd as a kernel process has to listen to the same port on every machine in the CTDB cluster.

tags: added: server-next
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers