From owner-freebsd-ports@FreeBSD.ORG Fri Jul 11 21:56:31 2008 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC5B3106564A for ; Fri, 11 Jul 2008 21:56:31 +0000 (UTC) (envelope-from sem@FreeBSD.org) Received: from mail.ciam.ru (ns.ciam.ru [213.247.195.75]) by mx1.freebsd.org (Postfix) with ESMTP id 7CFFA8FC18 for ; Fri, 11 Jul 2008 21:56:31 +0000 (UTC) (envelope-from sem@FreeBSD.org) Received: from [77.41.76.79] (helo=[172.16.100.4]) by mail.ciam.ru with esmtpa (Exim 4.x) id 1KHQbQ-000Ktw-4C; Sat, 12 Jul 2008 01:56:32 +0400 Message-ID: <4877D6BE.20909@FreeBSD.org> Date: Sat, 12 Jul 2008 01:55:10 +0400 From: Sergey Matveychuk User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: yvesguerin@yahoo.ca References: <490870.12555.qm@web56409.mail.re3.yahoo.com> In-Reply-To: <490870.12555.qm@web56409.mail.re3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: ports@FreeBSD.org Subject: Re: FreeBSD Port: upsd-2.0.1.6_1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 21:56:31 -0000 Yves Guérin wrote: > Hello, > > I redo the rc.d script > > #!/bin/sh > > > # PatrioteBSD - Yves Guerin - ygvesguerin@yah00.ca - 2008-07-10 > ######################################### > # JAMAIS TESTE AVEC upsd_enable="yes" > # NEVER TESTED WITH upsd_enable="YES" > ######################################### > > # mettre dans /etc/rc.conf: upsd_enable="YES" I don't think it's a good idea to have comments not in English. > # PROVIDE: upsd > # REQUIRE: DAEMON > # BEFORE: shutdown > > . /etc/rc.subr > > name="upsd" > upsd_enable=${upsd_enable:-"NO"} > rcvar=`set_rcvar` > > start_cmd="upsd_start" > stop_cmd="upsd_stop" > > upsd_start() > { > [ -x /usr/local/sbin/upsd ] && /usr/local/sbin/upsd && echo -n ' upsd' > } > > upsd_stop() > { > [ -f /var/run/upsd.pid ] && kill -QUIT `cat /var/run/upsd.pid` && echo -n ' upsd' > } Really start/stop could be (and should be) done with rc.subr subroutines. > > load_rc_config $name > run_rc_command "$1" -- Dixi. Sem.