]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
packaging: add debian packaging for ceph-mgr
authorJohn Spray <john.spray@redhat.com>
Mon, 26 Sep 2016 21:42:56 +0000 (22:42 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 29 Sep 2016 16:27:17 +0000 (17:27 +0100)
...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 <john.spray@redhat.com>
debian/.gitignore
debian/ceph-mgr.dirs [new file with mode: 0644]
debian/ceph-mgr.install [new file with mode: 0644]
debian/ceph-mgr.postinst [new file with mode: 0644]
debian/ceph-mgr.prerm [new file with mode: 0644]
debian/control
debian/rules
src/upstart/ceph-mgr-all-starter.conf [new file with mode: 0644]
src/upstart/ceph-mgr-all.conf [new file with mode: 0644]
src/upstart/ceph-mgr.conf [new file with mode: 0644]

index 0ea5249d8d71c8d5442bb8cc0df04ca58456c2db..35789301f40c90995ac5d59865d13ab038cc2aed 100644 (file)
@@ -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 (file)
index 0000000..636b3cf
--- /dev/null
@@ -0,0 +1 @@
+var/lib/ceph/mgr
diff --git a/debian/ceph-mgr.install b/debian/ceph-mgr.install
new file mode 100644 (file)
index 0000000..0ec0f70
--- /dev/null
@@ -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 (file)
index 0000000..6d38ccf
--- /dev/null
@@ -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 <most-recently-configured-version>
+#      old-postinst abort-upgrade <new-version>
+#      conflictor's-postinst abort-remove in-favour <package> <new-version>
+#      postinst abort-remove
+#      deconfigured's-postinst abort-deconfigure in-favour <failed-install-package> <version> [<removing conflicting-package> <version>]
+#
+
+# 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 (file)
index 0000000..6fb7b24
--- /dev/null
@@ -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
index 8f23c380caa2a6c8510d573caacb3a22f0abd0d9..7bbcd65ac96bc9b38016c8532b82165cfe1c24b3 100644 (file)
@@ -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}),
index bb705938de7c47b3aad38c4b56e0aeb48cefa02e..414120704cf39cad0e77580b017863663b30bd94 100755 (executable)
@@ -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 (file)
index 0000000..099b416
--- /dev/null
@@ -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 (file)
index 0000000..6be4fdb
--- /dev/null
@@ -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 (file)
index 0000000..11c36a5
--- /dev/null
@@ -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