Bug 824231 - move working directory of glusterd from '/etc/glusterd' to '/var/lib/glusterd'
move working directory of glusterd from '/etc/glusterd' to '/var/lib/glusterd'
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: glusterd (Show other bugs)
mainline
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: Raghavendra Bhat
Ujjwala
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-22 23:24 EDT by Amar Tumballi
Modified: 2013-12-18 19:08 EST (History)
5 users (show)

See Also:
Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-24 13:11:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Amar Tumballi 2012-05-22 23:24:22 EDT
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 01:07:01 EDT
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 08:10:28 EDT
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 10:13:21 EDT
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 01:30:11 EDT
this will make it to 3.3.1
Comment 5 Vijay Bellur 2012-07-03 08:02:53 EDT
CHANGE: http://review.gluster.com/3512 (mount.glusterfs: update the glusterd WORKDIR) merged in release-3.3 by Vijay Bellur (vijay@gluster.com)
Comment 6 Amar Tumballi 2012-07-04 05:17:46 EDT
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.