From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 46C01138334 for ; Fri, 9 Nov 2018 02:51:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB7C2E0D1B; Fri, 9 Nov 2018 02:51:55 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A7FB4E0D1B for ; Fri, 9 Nov 2018 02:51:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EB09A335CEB for ; Fri, 9 Nov 2018 02:51:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CC82C434 for ; Fri, 9 Nov 2018 02:51:49 +0000 (UTC) From: "Patrick McLean" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Patrick McLean" Message-ID: <1541731879.597620434ef1e96fc8bc544bcb2616ecc7b9bc4a.chutzpah@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/ceph/, sys-cluster/ceph/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-cluster/ceph/ceph-12.2.8-r1.ebuild sys-cluster/ceph/ceph-12.2.8.ebuild sys-cluster/ceph/ceph-13.2.2-r1.ebuild sys-cluster/ceph/ceph-13.2.2-r2.ebuild sys-cluster/ceph/files/ceph.initd-r9 sys-cluster/ceph/files/ceph.logrotate-r2 X-VCS-Directories: sys-cluster/ceph/ sys-cluster/ceph/files/ X-VCS-Committer: chutzpah X-VCS-Committer-Name: Patrick McLean X-VCS-Revision: 597620434ef1e96fc8bc544bcb2616ecc7b9bc4a X-VCS-Branch: master Date: Fri, 9 Nov 2018 02:51:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 37f0b0d1-369e-4400-8126-df48fee058b4 X-Archives-Hash: dc5b38287f150d21b2a970dac2707150 commit: 597620434ef1e96fc8bc544bcb2616ecc7b9bc4a Author: Patrick McLean gentoo org> AuthorDate: Fri Nov 9 02:51:19 2018 +0000 Commit: Patrick McLean gentoo org> CommitDate: Fri Nov 9 02:51:19 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59762043 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 gentoo.org> .../{ceph-12.2.8.ebuild => ceph-12.2.8-r1.ebuild} | 4 +- ...ceph-13.2.2-r1.ebuild => ceph-13.2.2-r2.ebuild} | 4 +- sys-cluster/ceph/files/ceph.initd-r9 | 97 ++++++++++++++++++++++ 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 similarity index 98% rename from sys-cluster/ceph/ceph-12.2.8.ebuild rename to sys-cluster/ceph/ceph-12.2.8-r1.ebuild index 56f05c940aa..5ccb12358e2 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 similarity index 99% rename from sys-cluster/ceph/ceph-13.2.2-r1.ebuild rename to sys-cluster/ceph/ceph-13.2.2-r2.ebuild index a657a929d8b..3035155be5e 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 00000000000..cfbd58e4b57 --- /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 00000000000..74d96e23823 --- /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: