diff options
author | Alexys Jacob <ultrabug@gentoo.org> | 2011-07-08 15:29:35 +0000 |
---|---|---|
committer | Alexys Jacob <ultrabug@gentoo.org> | 2011-07-08 15:29:35 +0000 |
commit | 4cfa24f76675e1cdc8341693e286f3d8fe93d27d (patch) | |
tree | d22c0b43e3e9d9290c5efe2677b4e39cc98f6715 /sys-cluster | |
parent | Mark the latest 0.23.1 as stable since I've been running it on both x86 and a... (diff) | |
download | historical-4cfa24f76675e1cdc8341693e286f3d8fe93d27d.tar.gz historical-4cfa24f76675e1cdc8341693e286f3d8fe93d27d.tar.bz2 historical-4cfa24f76675e1cdc8341693e286f3d8fe93d27d.zip |
Enhanced init script, add an autorestore functionnality. Drop old.
Package-Manager: portage-2.1.10.3/cvs/Linux x86_64
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/moosefs/ChangeLog | 10 | ||||
-rw-r--r-- | sys-cluster/moosefs/Manifest | 14 | ||||
-rw-r--r-- | sys-cluster/moosefs/files/mfs.confd | 10 | ||||
-rw-r--r-- | sys-cluster/moosefs/files/mfs.initd | 50 | ||||
-rw-r--r-- | sys-cluster/moosefs/moosefs-1.6.20-r1.ebuild (renamed from sys-cluster/moosefs/moosefs-1.6.20.ebuild) | 2 |
5 files changed, 65 insertions, 21 deletions
diff --git a/sys-cluster/moosefs/ChangeLog b/sys-cluster/moosefs/ChangeLog index c48142bf7472..f5f48a2265fb 100644 --- a/sys-cluster/moosefs/ChangeLog +++ b/sys-cluster/moosefs/ChangeLog @@ -1,10 +1,10 @@ # ChangeLog for sys-cluster/moosefs # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/moosefs/ChangeLog,v 1.1 2011/07/05 07:45:36 ultrabug Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/moosefs/ChangeLog,v 1.2 2011/07/08 15:29:35 ultrabug Exp $ -*moosefs-1.6.20 (05 Jul 2011) +*moosefs-1.6.20-r1 (08 Jul 2011) - 05 Jul 2011; Ultrabug <ultrabug@gentoo.org> +moosefs-1.6.20.ebuild, - +files/mfs.confd, +files/mfs.initd, +metadata.xml: - Initial import. Thanks to Mike Kazantsev for his initial work on bug #338004. + 08 Jul 2011; Ultrabug <ultrabug@gentoo.org> -moosefs-1.6.20.ebuild, + +moosefs-1.6.20-r1.ebuild, files/mfs.confd, files/mfs.initd: + Enhanced init script, add an autorestore functionnality. Drop old. diff --git a/sys-cluster/moosefs/Manifest b/sys-cluster/moosefs/Manifest index e941c3a87e28..b13610a0180c 100644 --- a/sys-cluster/moosefs/Manifest +++ b/sys-cluster/moosefs/Manifest @@ -1,16 +1,16 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 -AUX mfs.confd 108 RMD160 3fb4ae7a45f0e0cc0bde2afc73a5dba9f7385082 SHA1 2918a022d12a29b39300b5df0e746731a44f374c SHA256 5ddc2b3c5110e217cca024b908664c4e6f9481f725cfe6f486b57a8c0f0270ad -AUX mfs.initd 684 RMD160 5b0907b1760fd8ddf30dd838ed0d8f30427955c3 SHA1 b1f5bfee8b9ec424c620ef532162f9c4d1069695 SHA256 482456d0b5b97ed1b90dc2382bd6ff38a82e0eced5d4b64919639b58b611dca2 +AUX mfs.confd 368 RMD160 74784eff195a3baf07d07505fb518bcfdd6fda9e SHA1 e47cca98f9e677bcb4a71c829294e41506010c62 SHA256 be22c70e7a40a5373d18bfe17ec5a692f50b914c5c044a121a83cfb90a680c43 +AUX mfs.initd 1284 RMD160 ebe77392558ed7bb945c06b98ae6b8efb87216f4 SHA1 3d0f3f53753b523bdc60186c85c1c874b72239b3 SHA256 ba981b336e4a2b299825f43e6f071cd87276a8ae7cc259450ba9a9394aa3cd24 DIST mfs-1.6.20.tar.gz 657147 RMD160 039863f00882678cbba44db34eb7d2e755161925 SHA1 2d163a6fb15f98ba2a7b010ac1ec33f6cba40bfe SHA256 a3bf6c992a9b5724c37dea6c76091072e22f00a749d6aecc61d8c885607246a1 -EBUILD moosefs-1.6.20.ebuild 1262 RMD160 5f9f00c39e47b76288353c8209fc7e515c5006cf SHA1 093f00590177f05805b04b555dfff309845ae01f SHA256 e4e61f579bfb08d30fe44c5640d8b8a34f078cfa9ee26bd4da2245a664af8c26 -MISC ChangeLog 448 RMD160 abaf1e9b7df68f935e6c63e85cb72b843acb7890 SHA1 070010dc75aa96070a6737edb0a4e28a71438733 SHA256 ad34965979a61f767fa061fd39c2ac7eb0beb418fc6fcbc28adc2eaa2ac7fcf9 +EBUILD moosefs-1.6.20-r1.ebuild 1265 RMD160 3b74fa1ac6916e7f9dcd91bf574605b98ca4f038 SHA1 4cdae667dc413b8b5c6d092feb529b589b531a7b SHA256 c17fccfb26c8e35baf7d2b1adcbdb45592a0c38ddbd6d8e25e5e3676fc5e8f1a +MISC ChangeLog 450 RMD160 42fc733533ab6255ce51ee0fea89dfa9e67388d4 SHA1 6fe3dd891d41e040cbbcb3f802420f557fca4350 SHA256 dfec8698e62f7b572e7bd7188cdaf20eae04daea09c1574bde761dc9a23ff03c MISC metadata.xml 561 RMD160 d211a5158eec236f4516d6fc4a2e6993629384f7 SHA1 5464254a876d09e3fc5cd4f858ea9a419b3c9c4f SHA256 8af3c3972cc3b105e3b7c75cd515a898e094d428a6b7133e85c052547a86b44d -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) -iF4EAREIAAYFAk4SwSkACgkQKiQSS7ZY+hOzHgEAxV4JvvF3tUNu2t8XR/DXcyhK -Zvf27wL2NIOmp/jdn8YBANYmrK96uEEZlqlT3iZmsbsOwSAXQG91NM75mR03jawB -=V0YO +iF4EAREIAAYFAk4XImgACgkQKiQSS7ZY+hNT+gEA20JY8fArVzU/aLZBtdc0cTv6 +RmqhEIRAKIYvYqoZPOQA+gOemhrqVV02KQ4HBH5lL4DtWmNqu5A7y4V/G6FwISMQ +=ClUt -----END PGP SIGNATURE----- diff --git a/sys-cluster/moosefs/files/mfs.confd b/sys-cluster/moosefs/files/mfs.confd index 0dd704fb55e2..423795e33355 100644 --- a/sys-cluster/moosefs/files/mfs.confd +++ b/sys-cluster/moosefs/files/mfs.confd @@ -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="" + +# If the role mfsmaster fails to start, should we try to run mfsmetarestore -a ? +# Possible values: 0 (no), 1 (yes) +AUTORESTORE=0
\ No newline at end of file diff --git a/sys-cluster/moosefs/files/mfs.initd b/sys-cluster/moosefs/files/mfs.initd index ccdf1df0a2d3..b08d50c5d5d1 100644 --- a/sys-cluster/moosefs/files/mfs.initd +++ b/sys-cluster/moosefs/files/mfs.initd @@ -15,14 +15,45 @@ chkconfig() { return 0 } +autorestore() { + einfo "AUTORESTORE set, trying to restore metadata files" + mfsmetarestore -a &>/dev/null + return $? +} + +start_role() { + local ROLE=$1 + local RETURN=0 + + ebegin "${ROLE}" + start-stop-daemon -q --start --exec "${ROLE}" -- start >/dev/null + RETURN=$? + eend ${RETURN} + + return ${RETURN} +} + start_roles() { + local RETURN=0 + eindent for ROLE in ${ROLES}; do - einfo "${ROLE}" - "${ROLE}" start 2>&1 | logger -s -p daemon.info -t mfs + + start_role ${ROLE} || RETURN=$? + eend ${RETURN} + + if [ "${RETURN}" != "0" ] && [ "${ROLE}" == "mfsmaster" ] && [ ${AUTORESTORE} -eq 1 ]; then + eindent + autorestore && start_role ${ROLE} + RETURN=$? + eoutdent + fi + + [ "${RETURN}" != "0" ] && break done eoutdent - return 0 + + return ${RETURN} } start() { @@ -32,12 +63,17 @@ start() { } stop() { + local RETURN=0 + 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=$(echo ${ROLES} | tac -s' ') + for ROLE in ${REVERSE}; do + ebegin "${ROLE}" + start-stop-daemon -q --stop -n ${ROLE} || RETURN=$? + eend ${RETURN} done eoutdent - eend 0 + + eend ${RETURN} } diff --git a/sys-cluster/moosefs/moosefs-1.6.20.ebuild b/sys-cluster/moosefs/moosefs-1.6.20-r1.ebuild index 1d8d7b920d31..1d21150c5b00 100644 --- a/sys-cluster/moosefs/moosefs-1.6.20.ebuild +++ b/sys-cluster/moosefs/moosefs-1.6.20-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/moosefs/moosefs-1.6.20.ebuild,v 1.1 2011/07/05 07:45:36 ultrabug Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/moosefs/moosefs-1.6.20-r1.ebuild,v 1.1 2011/07/08 15:29:35 ultrabug Exp $ EAPI=4 |