diff options
author | Patrick McLean <chutzpah@gentoo.org> | 2018-11-08 18:51:19 -0800 |
---|---|---|
committer | Patrick McLean <chutzpah@gentoo.org> | 2018-11-08 18:51:19 -0800 |
commit | 597620434ef1e96fc8bc544bcb2616ecc7b9bc4a (patch) | |
tree | 35f7efe5a01876f0a311fe75cb01c9042fd8487f /sys-cluster/ceph | |
parent | dev-libs/icu: Drop obsolete >=gcc-4.9 system compiler check (diff) | |
download | gentoo-597620434ef1e96fc8bc544bcb2616ecc7b9bc4a.tar.gz gentoo-597620434ef1e96fc8bc544bcb2616ecc7b9bc4a.tar.bz2 gentoo-597620434ef1e96fc8bc544bcb2616ecc7b9bc4a.zip |
sys-cluster/ceph: revbump, fix logrotate problem in 12.2.8 and 13.2.2
Package-Manager: Portage-2.3.51, Repoman-2.3.12
RepoMan-Options: --force
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'sys-cluster/ceph')
-rw-r--r-- | sys-cluster/ceph/ceph-12.2.8-r1.ebuild (renamed from sys-cluster/ceph/ceph-12.2.8.ebuild) | 4 | ||||
-rw-r--r-- | sys-cluster/ceph/ceph-13.2.2-r2.ebuild (renamed from sys-cluster/ceph/ceph-13.2.2-r1.ebuild) | 4 | ||||
-rw-r--r-- | sys-cluster/ceph/files/ceph.initd-r9 | 97 | ||||
-rw-r--r-- | sys-cluster/ceph/files/ceph.logrotate-r2 | 33 |
4 files changed, 134 insertions, 4 deletions
diff --git a/sys-cluster/ceph/ceph-12.2.8.ebuild b/sys-cluster/ceph/ceph-12.2.8-r1.ebuild index 56f05c940aa1..5ccb12358e2f 100644 --- a/sys-cluster/ceph/ceph-12.2.8.ebuild +++ b/sys-cluster/ceph/ceph-12.2.8-r1.ebuild @@ -258,14 +258,14 @@ src_install() { newexe "${CMAKE_BUILD_DIR}/bin/init-ceph" ceph_init.sh insinto /etc/logrotate.d/ - newins "${FILESDIR}"/ceph.logrotate ${PN} + newins "${FILESDIR}"/ceph.logrotate-r2 ${PN} keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat fowners -R ceph:ceph /var/lib/ceph /var/log/ceph newinitd "${FILESDIR}/rbdmap.initd" rbdmap - newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r9" ${PN} newconfd "${FILESDIR}/${PN}.confd-r4" ${PN} insinto /etc/sysctl.d diff --git a/sys-cluster/ceph/ceph-13.2.2-r1.ebuild b/sys-cluster/ceph/ceph-13.2.2-r2.ebuild index a657a929d8b0..3035155be5e3 100644 --- a/sys-cluster/ceph/ceph-13.2.2-r1.ebuild +++ b/sys-cluster/ceph/ceph-13.2.2-r2.ebuild @@ -324,14 +324,14 @@ src_install() { newexe "${CMAKE_BUILD_DIR}/bin/init-ceph" ceph_init.sh insinto /etc/logrotate.d/ - newins "${FILESDIR}"/ceph.logrotate-r1 ${PN} + newins "${FILESDIR}"/ceph.logrotate-r2 ${PN} keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat fowners -R ceph:ceph /var/lib/ceph /var/log/ceph newinitd "${FILESDIR}/rbdmap.initd" rbdmap - newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r9" ${PN} newconfd "${FILESDIR}/${PN}.confd-r4" ${PN} insinto /etc/sysctl.d diff --git a/sys-cluster/ceph/files/ceph.initd-r9 b/sys-cluster/ceph/files/ceph.initd-r9 new file mode 100644 index 000000000000..cfbd58e4b571 --- /dev/null +++ b/sys-cluster/ceph/files/ceph.initd-r9 @@ -0,0 +1,97 @@ +#!/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}" +: ${rundir:=/run/ceph} +: ${user:=ceph} +: ${group:=ceph} +: ${rc_ulimit:=-n 1048576 -u 1048576} + +pidfile="${rundir}/supervisor-${daemon_type}.${daemon_id}.pid" +daemon_pidfile="${rundir}/${daemon_type}.${daemon_id}.pid" + +command="/usr/bin/${RC_SVCNAME%%.*}" +command_args="-i ${daemon_id} --pid-file ${daemon_pidfile} -c ${ceph_conf}" +command_args_foreground="--foreground" + +retry="${CEPH_TERMTIMEOUT:-TERM/120/KILL/5}" +start_stop_daemon_args="--user ${user} --group ${group}" +supervise_daemon_args="--user ${user} --group ${group}" + +: ${supervisor:=supervise-daemon} +: ${stdout:=/var/log/ceph/ceph} +: ${stderr:=/var/log/ceph/ceph} +: ${respawn_delay:=10} +: ${respawn_max:=5} +: ${respawn_period:=1800} + +: ${osd_respawn_delay:=15} +: ${osd_respawn_max:=10} + +: ${radosgw_respawn_max:=5} +: ${radosgw_respawn_period:=30} + +depend() { + use dns logger + after net ntpd ntp-client chronyd + before netmount +} + +is_type_valid() { + case ${daemon_type} in + mon|mds|osd|mgr|radosgw) return 0;; + *) return 1;; + esac +} + +start_pre() { + export CEPH_CONF="${ceph_conf}" + + checkpath -d -q -o "${user}:${group}" "${rundir}" + + if ! is_type_valid ;then + eerror "Please give valid Ceph Server Type: mds, mon, osd" + return 1 + + elif pgrep -f "[c]eph-${daemon_type} -i ${daemon_id} "; then + eerror "${daemon_type}.${daemon_id} is still running, refusing to start" + return 1 + fi + + local arg_name arg_val + for arg_name in std{out,err} respawn_{delay,max,period}; do + eval arg_val="\${${daemon_type}_${arg_name}}" + + if [ -z "${arg_val}" ]; then + eval arg_val="\${${arg_name}}" + else + eval "${arg_name}=\"${arg_val}\"" + fi + + if [ "${arg_name}" = "stderr" ] || [ "${arg_name}" = "stdout" ]; then + local log_file log_postfix + log_postfix=".${daemon_id}-${arg_name}.log" + log_file="${arg_val}" + + if [ "${log_file}" != /dev/null ]; then + log_file="${log_file}${log_postfix}" + fi + + checkpath -m 0755 -o "${user}:${group}" -d $(dirname "${log_file}") + + supervise_daemon_args="${supervise_daemon_args} --${arg_name//_/-}=${log_file}" + fi + done +} + +reload() { + ebegin "Reloading Ceph ${daemon_type}.${daemon_id}" + start-stop-daemon --signal 1 "${start_stop_daemon_args}" + eend ${?} +} + +# vim:ft=gentoo-init-d:ts=4:sts=4:sw=4:noet: diff --git a/sys-cluster/ceph/files/ceph.logrotate-r2 b/sys-cluster/ceph/files/ceph.logrotate-r2 new file mode 100644 index 000000000000..74d96e238231 --- /dev/null +++ b/sys-cluster/ceph/files/ceph.logrotate-r2 @@ -0,0 +1,33 @@ +# +# /etc/logrotate.d/ceph +# + +/var/log/ceph/*.log +{ + rotate 7 + daily + compress + sharedscripts + prerotate + for dmn in $(cd /run/ceph && ls *.asok 2>/dev/null); do + ceph --admin-daemon /run/ceph/${dmn} log flush 2>/dev/null >/dev/null + done + endscript + postrotate + for dmn in $(cd /run/ceph && ls *.asok 2>/dev/null); do + ceph --admin-daemon /run/ceph/${dmn} log reopen 2>/dev/null >/dev/null + done + endscript + missingok +} + +/var/log/ceph/console/*.log +{ + rotate 7 + daily + compress + missingok + copytruncate +} +# +# vim:ft=conf:ts=4:sts=4:sw=4:noet: |