From owner-freebsd-questions@FreeBSD.ORG Thu Jul 28 17:50:46 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB3E516A420 for ; Thu, 28 Jul 2005 17:50:46 +0000 (GMT) (envelope-from glenn@antimatter.net) Received: from cobalt.antimatter.net (cobalt.antimatter.net [69.55.224.239]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D0E743D55 for ; Thu, 28 Jul 2005 17:50:44 +0000 (GMT) (envelope-from glenn@antimatter.net) Received: from glenn-mobile.antimatter.net (cpe-66-27-86-22.san.res.rr.com [66.27.86.22]) (authenticated bits=0) by cobalt.antimatter.net (8.13.4/8.13.4) with ESMTP id j6SHohGi031884 (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NO); Thu, 28 Jul 2005 10:50:44 -0700 Message-Id: <6.1.0.6.2.20050728104154.1b1fe660@cobalt.antimatter.net> X-Sender: lists@cobalt.antimatter.net X-Mailer: QUALCOMM Windows Eudora Version 6.1.0.6 Date: Thu, 28 Jul 2005 10:47:04 -0700 To: Danny Howard , Lei Sun From: Glenn Dawson In-Reply-To: <20050728163651.GA200@ratchet.nebcorp.com> References: <6.1.0.6.2.20050726233906.198d9de0@cobalt.antimatter.net> <20050728163651.GA200@ratchet.nebcorp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: how to run 2 instance of memcached from rc.conf? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2005 17:50:46 -0000 At 09:36 AM 7/28/2005, Danny Howard wrote: >How are you giving anything different arguments? I only see one service >configured in your rc.conf. > > > So how do I use the same script to run 2 instance of memcached? From my original email: then, you can use two sets of variables in /etc/rc.conf like: memcached_enable="YES" memcached_flags="-m 2 -l 10.1.1.245 -p 11211" memcached2_enable="YES" memcached2_flags="-m 2 -l 10.1.1.245 -p 11212" -Glenn >So, you have memcached1.sh : > >#!/bin/sh ># > ># PROVIDE: memcached1 ># REQUIRE: NETWORKING > ># ># Add the following lines to /etc/rc.conf to run memcached: ># ># memcached1_enable="YES" ># memcached1_flags="" ># >. /etc/rc.subr > >name="memcached1" >rcvar=`set_rcvar` >command=/usr/local/bin/memcached >command_args="-du nobody ${memcached1_flags}" >load_rc_config $name >run_rc_command "$1" > >And then you have memcached2.sh : > >#!/bin/sh ># > ># PROVIDE: memcached2 ># REQUIRE: NETWORKING > ># ># Add the following lines to /etc/rc.conf to run memcached: ># ># memcached2_enable="YES" ># memcached2_flags="" ># >. /etc/rc.subr > >name="memcached2" >rcvar=`set_rcvar` >command=/usr/local/bin/memcached >command_args="-du nobody ${memcached2_flags}" >load_rc_config $name >run_rc_command "$1" > >And you set memcached1_flags and memcached2_flags in rc.conf where you >were setting memcache_flags formerly. > >However, unless you really know what you are doing, if you are trying to >run TWO memchached instances, I'd suspect, as another has asserted, that >your understanding of memcached is flawed. I'd check with the memcached >community to see if there isn't a better way to get things done in the >first place. > >Sincerely, >-danny > >-- >http://dannyman.toldme.com/ >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"