summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2017-03-16 19:20:08 -0700
committerPatrick McLean <chutzpah@gentoo.org>2017-03-16 19:20:08 -0700
commit881726f6fef97cd9f7e360d257e7b5450861143a (patch)
tree429907d0fbf97367fa0412b30a07ee9126bd0cf1 /sys-cluster/ceph/files
parentnet-im/kadu: Version bump 4.3 (diff)
downloadgentoo-881726f6fef97cd9f7e360d257e7b5450861143a.tar.gz
gentoo-881726f6fef97cd9f7e360d257e7b5450861143a.tar.bz2
gentoo-881726f6fef97cd9f7e360d257e7b5450861143a.zip
sys-cluster/ceph: Revision bump, some minor init script cleanups/enhancements
Package-Manager: Portage-2.3.4, Repoman-2.3.2
Diffstat (limited to 'sys-cluster/ceph/files')
-rw-r--r--sys-cluster/ceph/files/ceph.confd-r28
-rw-r--r--sys-cluster/ceph/files/ceph.initd-r449
2 files changed, 57 insertions, 0 deletions
diff --git a/sys-cluster/ceph/files/ceph.confd-r2 b/sys-cluster/ceph/files/ceph.confd-r2
new file mode 100644
index 000000000000..13b1cfad4588
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph.confd-r2
@@ -0,0 +1,8 @@
+# default ceph conf file
+#ceph_conf="/etc/ceph/ceph.conf"
+
+# Set ulimits for Ceph services.
+rc_ulimit="-n 32768"
+
+# initd stop timeout.
+#CEPH_TERMTIMEOUT="TERM/60/KILL/5"
diff --git a/sys-cluster/ceph/files/ceph.initd-r4 b/sys-cluster/ceph/files/ceph.initd-r4
new file mode 100644
index 000000000000..33e1a3002ac9
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph.initd-r4
@@ -0,0 +1,49 @@
+#!/sbin/openrc-run
+
+ceph_conf="${ceph_conf:-/etc/ceph/ceph.conf}"
+extra_commands="reload"
+daemon_type="${RC_SVCNAME#ceph-}"
+daemon_type="${daemon_type%%.*}"
+daemon_id="${RC_SVCNAME#ceph-*.}"
+daemon_id="${daemon_id:-0}"
+command="/usr/bin/ceph-${daemon_type}"
+pidfile="/run/ceph/${daemon_type}.${daemon_id}.pid"
+command_args="-i ${daemon_id} --pid-file ${pidfile} -c ${ceph_conf}"
+start_stop_daemon_args="--user ceph --group ceph"
+retry="${CEPH_TERMTIMEOUT:-TERM/60/KILL/5}"
+
+depend() {
+ after net ntpd ntp-client chronyd
+ before netmount
+}
+
+is_type_valid() {
+ case ${daemon_type} in
+ mon|mds|osd) return 0;;
+ *) return 1;;
+ esac
+}
+
+start_pre() {
+ export CEPH_CONF="${ceph_conf}"
+
+ checkpath -d -q -o ceph "$(dirname "${pidfile}")"
+
+ if ! is_type_valid ;then
+ eerror "Please give valid Ceph Server Type: mds, mon, osd"
+ return 1
+ fi
+
+ if pgrep -f "[c]eph-${daemon_type} -i ${daemon_id} "; then
+ eerror "${daemon_type}.${daemon_id} is still running, refusing to start"
+ return 1
+ fi
+}
+
+reload() {
+ ebegin "Reloading Ceph ${daemon_type}.${daemon_id}"
+ start-stop-daemon --signal 1 ${start_stop_daemon_args} --pidfile "${pidfile}"
+ eend $?
+}
+
+# vim:ft=gentoo-init-d:ts=4:sts=4:sw=4:noet: