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 1Q9K53-00062Q-09 for garchives@archives.gentoo.org; Mon, 11 Apr 2011 16:35:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 576701C051; Mon, 11 Apr 2011 16:34:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 181501C051 for ; Mon, 11 Apr 2011 16:34:40 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 81A7F1B40CA for ; Mon, 11 Apr 2011 16:34:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B808480065 for ; Mon, 11 Apr 2011 16:34:38 +0000 (UTC) From: "Alexys Jacob" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexys Jacob" Message-ID: <4e88c716a4b57f9ed0993a3de40c21793c902ad6.ultrabug@gentoo> Subject: [gentoo-commits] dev/ultrabug:master commit in: dev-db/mongodb/files/, dev-db/mongodb/ X-VCS-Repository: dev/ultrabug X-VCS-Files: dev-db/mongodb/Manifest dev-db/mongodb/files/mongos.confd dev-db/mongodb/files/mongos.initd X-VCS-Directories: dev-db/mongodb/files/ dev-db/mongodb/ X-VCS-Committer: ultrabug X-VCS-Committer-Name: Alexys Jacob X-VCS-Revision: 4e88c716a4b57f9ed0993a3de40c21793c902ad6 Date: Mon, 11 Apr 2011 16:34:38 +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: 3ebaa25859e22f25fd9b23759f39bdb7 commit: 4e88c716a4b57f9ed0993a3de40c21793c902ad6 Author: Ultrabug gentoo org> AuthorDate: Mon Apr 11 16:34:32 2011 +0000 Commit: Alexys Jacob gentoo org> CommitDate: Mon Apr 11 16:34:32 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/ultrabug.git;a= =3Dcommit;h=3D4e88c716 better mongos init script --- dev-db/mongodb/Manifest | 4 ++-- dev-db/mongodb/files/mongos.confd | 5 ++++- dev-db/mongodb/files/mongos.initd | 18 ++++++++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dev-db/mongodb/Manifest b/dev-db/mongodb/Manifest index a1b18a2..afe5c13 100644 --- a/dev-db/mongodb/Manifest +++ b/dev-db/mongodb/Manifest @@ -1,7 +1,7 @@ AUX mongodb-1.8-fix-scons.patch 1649 RMD160 1e5be2fe75f25c511b1d70dd1dd7= 977c8f1a6db3 SHA1 1300bbc5ff4f9c4a59e89fb3e119506b3507906d SHA256 5b8db8f= 66adabbdd52c364a713ce38a937c4ac6282a4ac530d14930d386d582d AUX mongodb.confd 277 RMD160 a6c7f01ecc843c9138046a5b4deaaff839b7bcc4 SH= A1 cb04bf6b4d3799846b9ab59dc587c88093d8e265 SHA256 b5b44beb64aae30f285c47= 64acbb8b2c7c60bd0cdcd47c6c11f285790c42b510 AUX mongodb.initd 921 RMD160 e26c0e82708bc05b8c5ae85212f6bba1f4799160 SH= A1 c542e418870d03ff5a2ff147094bd6c33ec5234e SHA256 c0765809103ab2a5ad806a= dfa8a850c05396c7b5db8af5ee379eb2ea043b654d -AUX mongos.confd 189 RMD160 56c0fb6d545da7ff5689c517b6b71f898e27c5a2 SHA= 1 1b3f6b072ac94a7ab29410096a7cab15a208171a SHA256 78e4ef078adf6a8add95546= f501d070019717c0bc4833672fbb2ad834d16b16c -AUX mongos.initd 758 RMD160 6e7691205f36b48a2e90ddbfc0697b654c33f74c SHA= 1 b69352503eb65a1900e93e45eb329958301d22f1 SHA256 ac6c6d0f65c7e65ee5d9d2a= 57e999346b6f5ed9e5e7e5440b40288d1807ac4d0 +AUX mongos.confd 261 RMD160 19839469426d2dc56987ccc442b02dac3646c909 SHA= 1 9412c5b9916618120c7cb62e113ed8a613b93217 SHA256 ee25bbdaf9c80dd33d7ce66= 2a932d4b08798a802820b9fa552379821a5c40d95 +AUX mongos.initd 1083 RMD160 7376258d119fad385dcbbc9361634eedaf5dcca4 SH= A1 ae29179137d61ee260d37e47e2004eb7c348ee23 SHA256 1a9154a2a91d35d3304ceb= bb627627f1c2977002a2a9e199c836d6cb5730bb55 DIST mongodb-src-r1.8.1.tar.gz 1718969 RMD160 e8739fd15c40eac9934045af43= 65c13f204d16fe SHA1 615cfe4ace4899e73a7083059c7178d8f5c19f03 SHA256 8b268= b4f8c4d055c74add1fc995f103d893657c4291964d370899ebefd0bc97d EBUILD mongodb-1.8.1.ebuild 2210 RMD160 96b48216b7e491260e984d47dfa54cb6= 1043ffba SHA1 16251ae0166743ea10fd9e162ca9e666c5d9bf72 SHA256 ea0e5e227f4= cb76cfefeaa25797e9efa258caded3d2137b4b2deab4ca6e6442b diff --git a/dev-db/mongodb/files/mongos.confd b/dev-db/mongodb/files/mon= gos.confd index 8a2bf88..44cbad8 100644 --- a/dev-db/mongodb/files/mongos.confd +++ b/dev-db/mongodb/files/mongos.confd @@ -4,7 +4,10 @@ MONGOS_RUN=3D"/var/run/mongodb" MONGOS_USER=3D"mongodb" =20 MONGOS_IP=3D"127.0.0.1" -MONGOS_PORT=3D"27018" +MONGOS_PORT=3D"27019" + +# 1 to 3 comma separated config servers (mendatory) +MONGOS_CONFIGDB=3D"" =20 # Set extra options here MONGOS_OPTIONS=3D"" diff --git a/dev-db/mongodb/files/mongos.initd b/dev-db/mongodb/files/mon= gos.initd index 978f5f8..90e2661 100644 --- a/dev-db/mongodb/files/mongos.initd +++ b/dev-db/mongodb/files/mongos.initd @@ -7,7 +7,20 @@ depend() { need net } =20 +checkconfig() { + if [ -z "${MONGOS_CONFIGDB}" ]; then + eerror "MONGOS_CONFIGDB is not defined, check your configuration file = !" + return 1 + fi + return 0 +} + start() { + checkconfig || return 1 + + mkdir -p ${MONGODB_RUN:-/var/run/mongodb} + chown ${MONGODB_USER:-mongodb}: ${MONGODB_RUN:-/var/run/mongodb} + ebegin "Starting ${SVCNAME}" start-stop-daemon --background --start --make-pidfile \ --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${SVCNAME}.pid \ @@ -18,12 +31,13 @@ start() { --port ${MONGOS_PORT:-27018} \ --unixSocketPrefix ${MONGOS_RUN:-/var/run/mongodb} \ --logappend --logpath /var/log/mongodb/${SVCNAME}.log \ + --configdb ${MONGOS_CONFIGDB} \ ${MONGOS_OPTIONS} eend $? } =20 stop() { ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${S= VCNAME}.pid + start-stop-daemon --stop --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SV= CNAME}.pid eend $? -} +} \ No newline at end of file