From: Sage Weil Date: Tue, 25 Aug 2015 16:32:22 +0000 (-0400) Subject: debian: /var/run/ceph should be owned by ceph:ceph X-Git-Tag: v9.1.0~294^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4456%2Fhead;p=ceph.git debian: /var/run/ceph should be owned by ceph:ceph Fix upstart and sysvinit scripts to create /var/run/ceph properly. Chown existing dir on upgrade. Signed-off-by: Sage Weil --- diff --git a/debian/ceph-common.postinst b/debian/ceph-common.postinst index 64769341759..36410a3b630 100644 --- a/debian/ceph-common.postinst +++ b/debian/ceph-common.postinst @@ -78,6 +78,13 @@ case "$1" in chmod u=rwx,g=rwxs,o=t /var/log/ceph fi + # 6. fix /var/run/ceph + if [ -d /var/run/ceph ]; then + echo -n "Fixing /var/run/ceph ownership.." + chown $SERVER_USER:$SERVER_GROUP /var/run/ceph + echo "..done" + fi + ;; abort-upgrade|abort-remove|abort-deconfigure) : diff --git a/src/init-ceph.in b/src/init-ceph.in index acb57d4a959..3e3b3a44cd5 100755 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -376,7 +376,10 @@ for name in $what; do fi echo Starting Ceph $name on $host... - mkdir -p $run_dir + if [ ! -d $run_dir ]; then + # assume /var/run exists + install -d -m0755 -o ceph -g ceph /var/run/ceph + fi get_conf pre_start_eval "" "pre start eval" [ -n "$pre_start_eval" ] && $pre_start_eval get_conf pre_start "" "pre start command" diff --git a/src/upstart/ceph-mds.conf b/src/upstart/ceph-mds.conf index a392aaee6e1..5c74fc16b2e 100644 --- a/src/upstart/ceph-mds.conf +++ b/src/upstart/ceph-mds.conf @@ -13,7 +13,7 @@ pre-start script test -x /usr/bin/ceph-mds || { stop; exit 0; } test -d "/var/lib/ceph/mds/${cluster:-ceph}-$id" || { stop; exit 0; } - install -d -m0755 /var/run/ceph + install -d -m0755 -o ceph -g ceph /var/run/ceph end script instance ${cluster:-ceph}/$id diff --git a/src/upstart/ceph-mon.conf b/src/upstart/ceph-mon.conf index c266f6cc9f1..be4e0efad60 100644 --- a/src/upstart/ceph-mon.conf +++ b/src/upstart/ceph-mon.conf @@ -13,7 +13,7 @@ pre-start script test -x /usr/bin/ceph-mon || { stop; exit 0; } test -d "/var/lib/ceph/mon/${cluster:-ceph}-$id" || { stop; exit 0; } - install -d -m0755 /var/run/ceph + install -d -m0755 -o ceph -g ceph /var/run/ceph end script instance ${cluster:-ceph}/$id diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf index f02f46571a0..a508b412627 100644 --- a/src/upstart/ceph-osd.conf +++ b/src/upstart/ceph-osd.conf @@ -13,7 +13,7 @@ pre-start script test -x /usr/bin/ceph-osd || { stop; exit 0; } test -d "/var/lib/ceph/osd/${cluster:-ceph}-$id" || { stop; exit 0; } - install -d -m0755 /var/run/ceph + install -d -m0755 -o ceph -g ceph /var/run/ceph /usr/libexec/ceph/ceph-osd-prestart.sh --cluster="${cluster:-ceph}" -i "$id" end script diff --git a/src/upstart/radosgw.conf b/src/upstart/radosgw.conf index fdc438006a9..4cb6b5d08db 100644 --- a/src/upstart/radosgw.conf +++ b/src/upstart/radosgw.conf @@ -13,7 +13,7 @@ pre-start script test -x /usr/bin/radosgw || { stop; exit 0; } test -d "/var/lib/ceph/radosgw/${cluster:-ceph}-$id" || { stop; exit 0; } - install -d -m0755 /var/run/ceph + install -d -m0755 -o ceph -g ceph /var/run/ceph end script instance ${cluster:-ceph}/$id