summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Zuckerman <louiszuckerman@gmail.com>2012-02-07 11:16:10 -0500
committerAnand Avati <avati@redhat.com>2012-03-18 00:34:57 -0700
commitc3bbf6aa6c090fd066ab0079aa1c8ae332309d2a (patch)
treef831e975668e5c3855549ef5cc1c94e9e181517e
parent598ab12c30b44c4c5f5922f3b76eec2ed8872790 (diff)
Updated the Ubuntu upstart jobs for glusterd in extras/Ubuntu.
Using upstart jobs, instead of an initscript, solves Bug 765014. See also: https://bugs.launchpad.net/ubuntu/+source/glusterfs/+bug/876648 The new upstart jobs split the work of starting glusterd & mounting glusterfs volumes into two parts: a glusterd service runner and a glusterfs volume moung blocker which waits for the service runner. This is the method preferred by Ubuntu developers to block a mounting event until a required service is available. These changes will be included in the Ubuntu glusterfs-server package starting with release 12.04, Precise Pangolin. Tested on Ubuntu 12.04 Change-Id: I9bb4e8cb05a1da0997c23f2ef7fea8737f6a2eb9 BUG: 765014 Signed-off-by: Louis Zuckerman <louiszuckerman@gmail.com> Reviewed-on: http://review.gluster.com/2727 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--extras/Ubuntu/README.Ubuntu28
-rw-r--r--extras/Ubuntu/glusterd.conf17
-rw-r--r--extras/Ubuntu/mounting-glusterfs.conf7
3 files changed, 28 insertions, 24 deletions
diff --git a/extras/Ubuntu/README.Ubuntu b/extras/Ubuntu/README.Ubuntu
index 651bd046e..0c5b7828d 100644
--- a/extras/Ubuntu/README.Ubuntu
+++ b/extras/Ubuntu/README.Ubuntu
@@ -1,20 +1,24 @@
-Bug 3282 - Mounting from localhost in fstab fails at boot on ubuntu
-(http://bugs.gluster.com/show_bug.cgi?id=3282)
+Bug 765014 - Mounting from localhost in fstab fails at boot on ubuntu
+(https://bugzilla.redhat.com/show_bug.cgi?id=765014)
+(https://bugs.launchpad.net/ubuntu/+source/glusterfs/+bug/876648)
Ubuntu uses upstart instead of init to bootstrap the system and it has a unique
-way of handling fstab, using a program called mountall(8). As a result,
-glusterfs mounts in fstab are tried before the glusterd service is running. In
-the case where the client is also a server and the volume is mounted from
-localhost, the mount fails at boot time. An upstart job for glusterd is needed
-to correct this.
+way of handling fstab, using a program called mountall(8). As a result of using
+a debian initscript to start glusterd, glusterfs mounts in fstab are tried before
+the glusterd service is running. In the case where the client is also a server
+and the volume is mounted from localhost, the mount fails at boot time. To
+correct this we need to launch glusterd using upstart and block the glusterfs
+mounting event until glusterd is started.
The glusterd.conf file contains the necessary configuration for upstart to
manage the glusterd service. It should be placed in /etc/init/glusterd.conf
on Ubuntu systems, and then the old initscript /etc/init.d/glusterd can be
-removed.
+removed. An additional upstart job, mounting-glusterfs.conf, is also required
+to block mounting glusterfs volumes until the glusterd service is available.
+Both of these upstart jobs need to be placed in /etc/init to resolve the issue.
-It can also be added to Ubuntu deb packages by placing it in debian/upstart
-inside the source package (or debian/glusterd.upstart if the source package
-builds multiple binary packages.)
+Starting with Ubuntu 12.04, Precise Pangolin, these upstart jobs will be
+included with the glusterfs-server package in the Ubuntu repository.
-This affects all versions of glusterfs on the ubuntu platform.
+This affects all versions of glusterfs on the Ubuntu platform since at least
+10.04, Lucid Lynx.
diff --git a/extras/Ubuntu/glusterd.conf b/extras/Ubuntu/glusterd.conf
index b987ffa13..aa99502b0 100644
--- a/extras/Ubuntu/glusterd.conf
+++ b/extras/Ubuntu/glusterd.conf
@@ -1,17 +1,10 @@
-# glusterd service upstart job
-#
-# Author: Louis Zuckerman <me@louiszuckerman.com>
+author "Louis Zuckerman <me@louiszuckerman.com>"
+description "GlusterFS Management Daemon"
-description "GlusterFS Management Daemon"
-
-start on (local-filesystems and net-device-up IFACE=lo and net-device-up IFACE=eth0) or (mounting TYPE=glusterfs)
+start on runlevel [2345]
stop on runlevel [016]
-respawn
-
-exec /usr/sbin/glusterd -N -p /var/run/glusterd.pid
+expect fork
-post-start script
- sleep 1
-end script
+exec /usr/sbin/glusterd -p /var/run/glusterd.pid
diff --git a/extras/Ubuntu/mounting-glusterfs.conf b/extras/Ubuntu/mounting-glusterfs.conf
new file mode 100644
index 000000000..3c59c0f63
--- /dev/null
+++ b/extras/Ubuntu/mounting-glusterfs.conf
@@ -0,0 +1,7 @@
+author "Louis Zuckerman <me@louiszuckerman.com>"
+description "Block the mounting event for glusterfs filesystems until glusterd is running"
+
+start on mounting TYPE=glusterfs
+task
+exec start wait-for-state WAIT_FOR=glusterd WAITER=mounting-glusterfs
+