From: John Spray Date: Mon, 26 Sep 2016 21:42:56 +0000 (+0100) Subject: packaging: add debian packaging for ceph-mgr X-Git-Tag: v11.0.1~60^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=042b6b44542cfd155e9be3a8a4de280470de7499;p=ceph-ci.git packaging: add debian packaging for ceph-mgr ...at least, try to! This is a copy-paste of the ceph-mds packaging with a search and replace mds to mgr. Signed-off-by: John Spray --- diff --git a/debian/.gitignore b/debian/.gitignore index 0ea5249d8d7..35789301f40 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -8,6 +8,8 @@ /ceph-fs-common /ceph-mds-dbg /ceph-mds +/ceph-mgr-dbg +/ceph-mgr /ceph-mon-dbg /ceph-mon /ceph-osd-dbg diff --git a/debian/ceph-mgr.dirs b/debian/ceph-mgr.dirs new file mode 100644 index 00000000000..636b3cf4a12 --- /dev/null +++ b/debian/ceph-mgr.dirs @@ -0,0 +1 @@ +var/lib/ceph/mgr diff --git a/debian/ceph-mgr.install b/debian/ceph-mgr.install new file mode 100644 index 00000000000..0ec0f7063db --- /dev/null +++ b/debian/ceph-mgr.install @@ -0,0 +1,2 @@ +usr/bin/ceph-mgr +usr/lib/ceph/mgr diff --git a/debian/ceph-mgr.postinst b/debian/ceph-mgr.postinst new file mode 100644 index 00000000000..6d38ccf09fe --- /dev/null +++ b/debian/ceph-mgr.postinst @@ -0,0 +1,51 @@ +#!/bin/sh +# vim: set noet ts=8: +# postinst script for ceph-mgr +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# +# postinst configure +# old-postinst abort-upgrade +# conflictor's-postinst abort-remove in-favour +# postinst abort-remove +# deconfigured's-postinst abort-deconfigure in-favour [ ] +# + +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +[ -f "/etc/default/ceph" ] && . /etc/default/ceph +[ -z "$SERVER_USER" ] && SERVER_USER=ceph +[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph + +case "$1" in + configure) + [ -x /sbin/start ] && start ceph-mgr-all || : + + if ! dpkg-statoverride --list /var/lib/ceph/mgr >/dev/null + then + chown $SERVER_USER:$SERVER_GROUP /var/lib/ceph/mgr + fi + ;; + abort-upgrade|abort-remove|abort-deconfigure) + : + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/ceph-mgr.prerm b/debian/ceph-mgr.prerm new file mode 100644 index 00000000000..6fb7b245a78 --- /dev/null +++ b/debian/ceph-mgr.prerm @@ -0,0 +1,23 @@ +#!/bin/sh +# vim: set noet ts=8: + +set -e + +case "$1" in + remove) + [ -x /sbin/stop ] && stop ceph-mgr-all || : + invoke-rc.d ceph stop mgr || { + RESULT=$? + if [ $RESULT != 100 ]; then + exit $RESULT + fi + } + ;; + + *) + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/control b/debian/control index 8f23c380caa..7bbcd65ac96 100644 --- a/debian/control +++ b/debian/control @@ -73,6 +73,7 @@ Standards-Version: 3.9.3 Package: ceph Architecture: linux-any Depends: ceph-mon (= ${binary:Version}), + ceph-mgr (= ${binary:Version}), ceph-osd (= ${binary:Version}) Recommends: ceph-mds (= ${binary:Version}) Description: distributed storage and file system @@ -111,8 +112,8 @@ Description: common ceph daemon libraries and management tools block and file system storage. . This package contains the libraries and management tools that are common among - the three Ceph server daemons (ceph-mon, ceph-osd, ceph-mds). These tools are - necessary for creating, running, and administering a Ceph storage cluster. + the Ceph server daemons (ceph-mon, ceph-mgr, ceph-osd, ceph-mds). These tools + are necessary for creating, running, and administering a Ceph storage cluster. Package: ceph-mds Architecture: linux-any @@ -141,6 +142,31 @@ Description: debugging symbols for ceph-mds . This package contains the debugging symbols for ceph-mds. +Package: ceph-mgr +Architecture: linux-any +Depends: ceph-base (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Replaces: ceph (<< 0.93-417) +Breaks: ceph (<< 0.93-417) +Description: metadata server for the ceph distributed file system + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + This package contains the manager daemon, which is used to expose high + level management and monitoring functionality. + +Package: ceph-mgr-dbg +Architecture: linux-any +Section: debug +Priority: extra +Depends: ceph-mgr (= ${binary:Version}), ${misc:Depends} +Description: debugging symbols for ceph-mgr + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + This package contains the debugging symbols for ceph-mgr. + Package: ceph-mon Architecture: linux-any Depends: ceph-base (= ${binary:Version}), diff --git a/debian/rules b/debian/rules index bb705938de7..414120704cf 100755 --- a/debian/rules +++ b/debian/rules @@ -65,6 +65,8 @@ override_dh_installinit: install -m0644 src/upstart/rbdmap.conf debian/ceph-common/etc/init install -d -m0755 debian/ceph-mds/etc/init install -m0644 src/upstart/ceph-mds*.conf debian/ceph-mds/etc/init + install -d -m0755 debian/ceph-mgr/etc/init + install -m0644 src/upstart/ceph-mgr*.conf debian/ceph-mgr/etc/init install -d -m0755 debian/radosgw/etc/init install -m0644 src/upstart/radosgw*.conf debian/radosgw/etc/init install -d -m0755 debian/rbd-mirror/etc/init @@ -97,6 +99,11 @@ override_dh_installinit: sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mds/lib/systemd/system/ceph-mds@.service install -m0644 systemd/ceph-mds.target debian/ceph-mds/lib/systemd/system + install -d -m0755 debian/ceph-mgr/lib/systemd/system + install -m0644 systemd/ceph-mgr@.service debian/ceph-mgr/lib/systemd/system + sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mgr/lib/systemd/system/ceph-mgr@.service + install -m0644 systemd/ceph-mgr.target debian/ceph-mgr/lib/systemd/system + install -d -m0755 debian/radosgw/lib/systemd/system install -m0644 systemd/ceph-radosgw@.service debian/radosgw/lib/systemd/system sed -i s./etc/sysconfig/./etc/default/.g debian/radosgw/lib/systemd/system/ceph-radosgw@.service @@ -115,6 +122,7 @@ override_dh_systemd_start: override_dh_strip: dh_strip -pceph-mds --dbg-package=ceph-mds-dbg + dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg dh_strip -pceph-mon --dbg-package=ceph-mon-dbg dh_strip -pceph-osd --dbg-package=ceph-osd-dbg dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg diff --git a/src/upstart/ceph-mgr-all-starter.conf b/src/upstart/ceph-mgr-all-starter.conf new file mode 100644 index 00000000000..099b416d6ea --- /dev/null +++ b/src/upstart/ceph-mgr-all-starter.conf @@ -0,0 +1,17 @@ +description "Ceph Manager (start all instances)" + +start on starting ceph-mgr-all + +task + +script + set -e + find -L /var/lib/ceph/mgr/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ + | while read f; do + if [ -e "/var/lib/ceph/mgr/$f/done" ] && [ -e "/var/lib/ceph/mgr/$f/upstart" ] && [ ! -e "/var/lib/ceph/mgr/$f/sysvinit" ]; then + cluster="${f%%-*}" + id="${f#*-}" + initctl emit ceph-mgr cluster="$cluster" id="$id" + fi + done +end script diff --git a/src/upstart/ceph-mgr-all.conf b/src/upstart/ceph-mgr-all.conf new file mode 100644 index 00000000000..6be4fdbb0bb --- /dev/null +++ b/src/upstart/ceph-mgr-all.conf @@ -0,0 +1,4 @@ +description "Ceph Manager (all instances)" + +start on starting ceph-all +stop on stopping ceph-all diff --git a/src/upstart/ceph-mgr.conf b/src/upstart/ceph-mgr.conf new file mode 100644 index 00000000000..11c36a5673b --- /dev/null +++ b/src/upstart/ceph-mgr.conf @@ -0,0 +1,26 @@ +description "Ceph Manager" + +start on ceph-mgr +stop on runlevel [!2345] or stopping ceph-mgr-all + +respawn +respawn limit 3 1800 + +limit nofile 16384 16384 + +pre-start script + set -e + test -x /usr/bin/ceph-mgr || { stop; exit 0; } + test -d "/var/lib/ceph/mgr/${cluster:-ceph}-$id" || { stop; exit 0; } + + install -d -m0770 -o ceph -g ceph /var/run/ceph +end script + +instance ${cluster:-ceph}/$id +export cluster +export id + +# this breaks oneiric +#usage "cluster = name of cluster (defaults to 'ceph'); id = mgr instance id" + +exec /usr/bin/ceph-mgr --cluster="${cluster:-ceph}" -i "$id" -f --setuser ceph --setgroup ceph