Bug 824231 - move working directory of glusterd from '/etc/glusterd' to '/var/lib/glusterd'
Summary: move working directory of glusterd from '/etc/glusterd' to '/var/lib/glusterd'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: glusterd
Version: mainline
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
Assignee: Raghavendra Bhat
QA Contact: Ujjwala
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-23 03:24 UTC by Amar Tumballi
Modified: 2013-12-19 00:08 UTC (History)
5 users (show)

Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-24 17:11:01 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Amar Tumballi 2012-05-23 03:24:22 UTC
Description of problem:
Currently, for release-3.3 branch and on master branch, if one installs GlusterFS using RPMs, the working directory will become /var/lib/glusterd, but not in case of source install (and other distro installs). It makes sense to keep all type of install behave same.

Version-Release number of selected component (if applicable):
release-3.3/master

Comment 1 Amar Tumballi 2012-05-30 05:07:01 UTC
http://review.gluster.com/3479 fixes it in release-3.3, http://review.gluster.com/3338 is queued up for master.

Comment 2 Ujjwala 2012-06-01 12:10:28 UTC
Did source install from 3.3.0 qa41 to 3.3.0 community release. The working directory is moved from /etc/glusterd to /var/lib/glusterd.

Comment 3 Raghavendra Bhat 2012-06-08 14:13:21 UTC
The migration of /etc/glusterd to /var/lib/glusterd is smooth when source installation is done. Whereas if the upgrade is rpm upgrade (in my case 3.2.6 to 3.3.0), is failing with following o/p.

[root@gqas009 final]# rpm -Uvh glusterfs-server-3.3.0-1.x86_64.rpm
warning: glusterfs-server-3.3.0-1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID cae81a29: NOKEY
Preparing...                ########################################### [100%]
   1:glusterfs-server       ########################################### [100%]
mv: cannot move `/etc/glusterd' to `/var/lib/glusterd': Directory not empty


Reason:
When 3.3.0 packages are being installed when new (3.3.0)glusterd is started it sees that there is no /var/lib/glusterd and creates them.

Since /var/lib/glusterd is already there this part of the upgrade script fails.


# Move legacy sysconf files to the correct sysconfdir
if [ -d /etc/glusterd ]; then
    mkdir -p /var/lib
    mv /etc/glusterd /var/lib/
    ln -sf /var/lib/glusterd /etc/glusterd
fi


Above it tries to move /etc/glusterd to /var/lib, finds non-empty glusterd directory (created by glusterd process) and errors out without upgrading.

The below changes to the spec files fixes the issue.

git branch
  master
* release-3.3
[root@gqas009 glusterfs.git]# git diff
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index c425e06..412b3fb 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -305,7 +305,8 @@ fi
 # Move legacy sysconf files to the correct sysconfdir
 if [ -d /etc/glusterd ]; then
     mkdir -p /var/lib
-    mv /etc/glusterd /var/lib/
+    cp -a /etc/glusterd /var/lib/;
+    rm -rf /etc/glusterd
     ln -sf /var/lib/glusterd /etc/glusterd
 fi

[root@gqas009 glusterfs.git]#

Comment 4 Amar Tumballi 2012-06-12 05:30:11 UTC
this will make it to 3.3.1

Comment 5 Vijay Bellur 2012-07-03 12:02:53 UTC
CHANGE: http://review.gluster.com/3512 (mount.glusterfs: update the glusterd WORKDIR) merged in release-3.3 by Vijay Bellur (vijay)

Comment 6 Amar Tumballi 2012-07-04 09:17:46 UTC
http://review.gluster.com/3548 got pushed to upstream as part of bug 230218


Note You need to log in before you can comment on or make changes to this bug.