Gentoo Archives: gentoo-commits

From: "Benedikt Boehm (hollow)" <hollow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/rabbitmq-server/files: rabbitmq-script-wrapper rabbitmq-server.init-r1
Date: Sat, 28 Aug 2010 14:33:07
Message-Id: 20100828143303.0389020051@flycatcher.gentoo.org
1 hollow 10/08/28 14:33:02
2
3 Added: rabbitmq-script-wrapper rabbitmq-server.init-r1
4 Log:
5 version bump wrt #334543. also fixes #332391.
6 (Portage version: 2.2_rc67/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 net-misc/rabbitmq-server/files/rabbitmq-script-wrapper
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/rabbitmq-server/files/rabbitmq-script-wrapper?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/rabbitmq-server/files/rabbitmq-script-wrapper?rev=1.1&content-type=text/plain
13
14 Index: rabbitmq-script-wrapper
15 ===================================================================
16 #!/bin/sh
17 ## The contents of this file are subject to the Mozilla Public License
18 ## Version 1.1 (the "License"); you may not use this file except in
19 ## compliance with the License. You may obtain a copy of the License at
20 ## http://www.mozilla.org/MPL/
21 ##
22 ## Software distributed under the License is distributed on an "AS IS"
23 ## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
24 ## License for the specific language governing rights and limitations
25 ## under the License.
26 ##
27 ## The Original Code is RabbitMQ.
28 ##
29 ## The Initial Developers of the Original Code are LShift Ltd,
30 ## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
31 ##
32 ## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
33 ## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
34 ## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
35 ## Technologies LLC, and Rabbit Technologies Ltd.
36 ##
37 ## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
38 ## Ltd. Portions created by Cohesive Financial Technologies LLC are
39 ## Copyright (C) 2007-2009 Cohesive Financial Technologies
40 ## LLC. Portions created by Rabbit Technologies Ltd are Copyright
41 ## (C) 2007-2009 Rabbit Technologies Ltd.
42 ##
43 ## All Rights Reserved.
44 ##
45 ## Contributor(s): ______________________________________.
46 ##
47
48 # Escape spaces and quotes, because shell is revolting.
49 for arg in "$@" ; do
50 # Escape quotes in parameters, so that they're passed through cleanly.
51 arg=$(sed -e 's/"/\\"/g' <<-END
52 $arg
53 END
54 )
55 CMDLINE="${CMDLINE} \"${arg}\""
56 done
57
58 cd /var/lib/rabbitmq
59
60 SCRIPT=`basename $0`
61
62 if [ `id -u` = 0 ] ; then
63 su rabbitmq -s /bin/sh -c "/usr/libexec/rabbitmq/${SCRIPT} ${CMDLINE}"
64 else
65 /usr/libexec/rabbitmq/${SCRIPT}
66 echo -e "\nOnly root should run ${SCRIPT}\n"
67 exit 1
68 fi
69
70
71
72 1.1 net-misc/rabbitmq-server/files/rabbitmq-server.init-r1
73
74 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/rabbitmq-server/files/rabbitmq-server.init-r1?rev=1.1&view=markup
75 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/rabbitmq-server/files/rabbitmq-server.init-r1?rev=1.1&content-type=text/plain
76
77 Index: rabbitmq-server.init-r1
78 ===================================================================
79 #!/sbin/runscript
80 # Copyright 1999-2010 Gentoo Foundation
81 # Distributed under the terms of the GNU General Public License v2
82 # $Header: /var/cvsroot/gentoo-x86/net-misc/rabbitmq-server/files/rabbitmq-server.init-r1,v 1.1 2010/08/28 14:33:02 hollow Exp $
83
84 depend() {
85 # uncomment this as soon as bug 334979 is fixed
86 #need epmd
87 need net
88 use dns
89 }
90
91 start() {
92 ebegin "Starting RabbitMQ..."
93 /usr/sbin/rabbitmq-multi start_all ${NODE_COUNT:-1} >> /var/log/rabbitmq/startup.log 2>> /var/log/rabbitmq/startup.err
94 eend $?
95 }
96
97 stop() {
98 ebegin "Stopping RabbitMQ..."
99 /usr/sbin/rabbitmq-multi stop_all >> /var/log/rabbitmq/shutdown.log 2>> /var/log/rabbitmq/shutdown.err
100 eend $?
101 }