From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QfCzx-0006d6-SH for garchives@archives.gentoo.org; Fri, 08 Jul 2011 15:29:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 49EB721C03A; Fri, 8 Jul 2011 15:29:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0B47621C03A for ; Fri, 8 Jul 2011 15:29:37 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1C1AC2AC0EE for ; Fri, 8 Jul 2011 15:29:37 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2287) id D0A4520051; Fri, 8 Jul 2011 15:29:35 +0000 (UTC) From: "Alexys Jacob (ultrabug)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, ultrabug@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in sys-cluster/moosefs/files: mfs.initd mfs.confd X-VCS-Repository: gentoo-x86 X-VCS-Files: mfs.initd mfs.confd X-VCS-Directories: sys-cluster/moosefs/files X-VCS-Committer: ultrabug X-VCS-Committer-Name: Alexys Jacob Content-Type: text/plain; charset=utf8 Message-Id: <20110708152935.D0A4520051@flycatcher.gentoo.org> Date: Fri, 8 Jul 2011 15:29:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 285f999fc31f9a1e0aa2684032131f23 ultrabug 11/07/08 15:29:35 Modified: mfs.initd mfs.confd Log: Enhanced init script, add an autorestore functionnality. Drop old. =20 (Portage version: 2.1.10.3/cvs/Linux x86_64) Revision Changes Path 1.2 sys-cluster/moosefs/files/mfs.initd file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/moosef= s/files/mfs.initd?rev=3D1.2&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/moosef= s/files/mfs.initd?rev=3D1.2&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/moosef= s/files/mfs.initd?r1=3D1.1&r2=3D1.2 Index: mfs.initd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/sys-cluster/moosefs/files/mfs.initd,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mfs.initd 5 Jul 2011 07:45:36 -0000 1.1 +++ mfs.initd 8 Jul 2011 15:29:35 -0000 1.2 @@ -15,14 +15,45 @@ return 0 } =20 +autorestore() { + einfo "AUTORESTORE set, trying to restore metadata files" + mfsmetarestore -a &>/dev/null + return $? +} + +start_role() { + local ROLE=3D$1 + local RETURN=3D0 + + ebegin "${ROLE}" + start-stop-daemon -q --start --exec "${ROLE}" -- start >/dev/null + RETURN=3D$? + eend ${RETURN} + + return ${RETURN} +} + start_roles() { + local RETURN=3D0 + eindent for ROLE in ${ROLES}; do - einfo "${ROLE}" - "${ROLE}" start 2>&1 | logger -s -p daemon.info -t mfs + + start_role ${ROLE} || RETURN=3D$? + eend ${RETURN} + + if [ "${RETURN}" !=3D "0" ] && [ "${ROLE}" =3D=3D "mfsmaster" ] && [ $= {AUTORESTORE} -eq 1 ]; then + eindent + autorestore && start_role ${ROLE} + RETURN=3D$? + eoutdent + fi + + [ "${RETURN}" !=3D "0" ] && break done eoutdent - return 0 + + return ${RETURN} } =20 start() { @@ -32,12 +63,17 @@ } =20 stop() { + local RETURN=3D0 + ebegin "Stopping mfs node" eindent - for ROLE in ${ROLES}; do - einfo "${ROLE}" - "${ROLE}" stop 2>&1 | logger -s -p daemon.info -t mfs + local REVERSE=3D$(echo ${ROLES} | tac -s' ') + for ROLE in ${REVERSE}; do + ebegin "${ROLE}" + start-stop-daemon -q --stop -n ${ROLE} || RETURN=3D$? + eend ${RETURN} done eoutdent - eend 0 + + eend ${RETURN} } 1.2 sys-cluster/moosefs/files/mfs.confd file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/moosef= s/files/mfs.confd?rev=3D1.2&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/moosef= s/files/mfs.confd?rev=3D1.2&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/moosef= s/files/mfs.confd?r1=3D1.1&r2=3D1.2 Index: mfs.confd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/sys-cluster/moosefs/files/mfs.confd,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mfs.confd 5 Jul 2011 07:45:36 -0000 1.1 +++ mfs.confd 8 Jul 2011 15:29:35 -0000 1.2 @@ -1,3 +1,11 @@ # Which mooseFS roles should we start ? -# Possible values: mfsmetalogger mfschunkserver mfsmaster +# +# NOTE: The roles are stopped in *reverse* order of the given list +# so make sure to list mfsmaster *before* the other roles. +# +# Possible values: mfsmaster mfsmetalogger mfschunkserver #ROLES=3D"" + +# If the role mfsmaster fails to start, should we try to run mfsmetarest= ore -a ? +# Possible values: 0 (no), 1 (yes) +AUTORESTORE=3D0 \ No newline at end of file