From owner-freebsd-questions@FreeBSD.ORG Tue Oct 5 18:16:26 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2665A1065670 for ; Tue, 5 Oct 2010 18:16:26 +0000 (UTC) (envelope-from emss.mail@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9D95D8FC21 for ; Tue, 5 Oct 2010 18:16:25 +0000 (UTC) Received: by wwb24 with SMTP id 24so39208wwb.31 for ; Tue, 05 Oct 2010 11:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received :x-virus-scanned:received:received:to:cc:subject:from:in-reply-to :references:x-operating-system:date:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=cwhgDzftMYtkaEtzpmoVJK7KcTmdHJobKTCiURMXG9g=; b=AeUCOyZ52Eh2GN1b+mcqJXHemvrVAJ2e2AEQDyHGvQeguiV/RlxRNHH1R5lTnhcWNR E9Hga3KqKxy+rssQXi4kgEL9ZZz13M0e2xSX5U4JOhQwpAhTQ6tYg7LkmZ1ZaBZc1Xbi dkQLwDx3FieKQdP+CezUNvBRTWNN48FBfNGmA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:x-virus-scanned:to:cc:subject:from:in-reply-to:references :x-operating-system:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; b=UXB7JTA1PTPexjUUgpp/5EtRWkgP+pcnazbMyg0h/Wqc71XIZE+/D3EBXIfqpRq1ej Os5OpwsO3rC54+FLBPBUh1X1y/gTaiGs/iljp8OOi4h1N+s3awImkPwM3D0GzIPn1R9p I7rm1Z8okN+T8AhKuuSI5kZ29+pXkvt2t5G7g= Received: by 10.227.151.193 with SMTP id d1mr9206265wbw.151.1286302584547; Tue, 05 Oct 2010 11:16:24 -0700 (PDT) Received: from srvbsdfenssv.interne.associated-bears.org (LCaen-151-92-21-48.w217-128.abo.wanadoo.fr [217.128.200.48]) by mx.google.com with ESMTPS id bc3sm5593145wbb.2.2010.10.05.11.16.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Oct 2010 11:16:20 -0700 (PDT) Sender: Eric Masson Received: from srvbsdfenssv.interne.associated-bears.org (localhost [127.0.0.1]) by srvbsdfenssv.interne.associated-bears.org (Postfix) with ESMTP id B881A1CF2C; Tue, 5 Oct 2010 20:16:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at interne.associated-bears.org Received: from srvbsdfenssv.interne.associated-bears.org ([127.0.0.1]) by srvbsdfenssv.interne.associated-bears.org (srvbsdfenssv.interne.associated-bears.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UIuJ1Sg3uohp; Tue, 5 Oct 2010 20:16:14 +0200 (CEST) Received: by srvbsdfenssv.interne.associated-bears.org (Postfix, from userid 1001) id BA14B1CC4B; Tue, 5 Oct 2010 20:16:14 +0200 (CEST) To: RW From: Eric Masson In-Reply-To: <20101005141158.4730dab3@gumby.homeunix.com> (RW's message of "Tue, 5 Oct 2010 14:11:58 +0100") References: <86d3ronb01.fsf@srvbsdfenssv.interne.associated-bears.org> <20101005141158.4730dab3@gumby.homeunix.com> X-Operating-System: FreeBSD 8.1-RELEASE-p1 amd64 Date: Tue, 05 Oct 2010 20:16:14 +0200 Message-ID: <8639skmro1.fsf@srvbsdfenssv.interne.associated-bears.org> User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b28 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org Subject: Re: Custom rc script using /usr/sbin/daemon 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: Tue, 05 Oct 2010 18:16:26 -0000 RW writes: Hello, > I don't think you can do it like that. IIRC when you try to stop a > daemon it doesn't just kill the process by pid, it also sanity checks > the command in case the daemon has died and the pid was reused. > Since "daemon" wont show-up in the ps output it can't be in the command > variable. Ok, makes sense. > I think you need to write a start function, something like this: > > > start_cmd="phpfastcgi_start" > command="/usr/local/bin/php-cgi" > > phpfastcgi_start(){ > echo "starting phpfastcgi." > /usr/sbin/daemon -f -p ${pidfile} ${command} > } Fine, it works much better now. Thanks a lot Kind Regards Éric Masson -- je n'ai jamais repondu aux AAD car je pensais qu'on pouvais pas en tant que personne qui propose un newgroup... -+- A in GNU : C'est quoi un groupe de discussion d'ailleurs ? -+-