From owner-freebsd-rc@FreeBSD.ORG Sat May 21 06:58:11 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1561065670; Sat, 21 May 2011 06:58:11 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 788208FC0A; Sat, 21 May 2011 06:58:10 +0000 (UTC) Received: by bwz12 with SMTP id 12so4935053bwz.13 for ; Fri, 20 May 2011 23:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=vI8XDOMLdi/oq6oeq3nuffXPK9oupBY/i7IO0XEDS9s=; b=qIvwmcX5ePXi6+pKegPiwQyKwQfbw4pnGO5ECSkmhkGjEh2eIGJWI+Orode8kQQBxl Ii+ztGrRGl+1Dnd//oWiwzJkO9gg5ztgVsKAORjVjZmQCOPE9Q8SokIhqLkI7FqvRu6F RfDrlvABu3kk4HQJxcd5WdpiGcBhfMUrDcUNs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; b=vhwLQ0fq0qN3sx6QiKjJCCgHYcfcb0zSVKUz1SNV3bV7zTfrWmqJWPQJIvuMRjgEJ5 aFy+JNM92QLlcCnSbF1tOES2dGPYBufbh+BL5+XrcTx1e4yDB3ySAOx0sTdC0zTrmeLi NMJ+e+qNUpg3giK3xx0iVMHj16eifrb3Rar6s= Received: by 10.204.141.12 with SMTP id k12mr355635bku.44.1305961089088; Fri, 20 May 2011 23:58:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.205.65.198 with HTTP; Fri, 20 May 2011 23:57:39 -0700 (PDT) In-Reply-To: <4DD6993F.3080709@FreeBSD.org> References: <4DD6993F.3080709@FreeBSD.org> From: Chris Rees Date: Sat, 21 May 2011 07:57:39 +0100 Message-ID: To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-rc@freebsd.org Subject: Re: get_pidfile_from_conf usage X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: utisoft@gmail.com List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 06:58:11 -0000 On 20 May 2011 17:39, Doug Barton wrote: > On 19/05/2011 12:15, Chris Rees wrote: >> >> Hi all, >> >> I know it's been done to death recently, and there're examples in >> slim, but I'd just like some clarity here -- I'm sticking it into >> musicpd.in. > > slim is a particularly odd/complex case due to the way that it is tied > deeply to X. named and devd are simpler examples. > >> Is it absolutely necessary to define a precmd and postcmd to get the >> pidfile, or can I just set prestart_cmd=find_pidfile&& >> prestop_cmd=find_pidfile? > > It needs to be run in both start and stop _precmd because both need to know > the pid file location. You need to test for the function's existence in > ports because it won't be there for all systems we support for years yet. > However, the feature has been MFC'ed so it will be in all of the next > releases. > > You could use the find_pidfile method from slim, and if I understand what > you're asking above, and you have no other start/stop _precmd you could do > the following: > > start_precmd=find_pidfile > stop_precmd=find_pidfile You have understood exactly what I was asking, thanks. > >> How do I get status working properly; it doesn't look right in slim... > > Works fine for me: > > # service named status > named is running as pid 1532. > > # service slim status > slim is running as pid 1791. Oh yes, I know it _works_, but it's ignorant of $pidfile. Is this OK? Chris