Date: Sat, 12 Jul 2008 01:55:10 +0400 From: Sergey Matveychuk <sem@FreeBSD.org> To: yvesguerin@yahoo.ca Cc: ports@FreeBSD.org Subject: Re: FreeBSD Port: upsd-2.0.1.6_1 Message-ID: <4877D6BE.20909@FreeBSD.org> In-Reply-To: <490870.12555.qm@web56409.mail.re3.yahoo.com> References: <490870.12555.qm@web56409.mail.re3.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4877D6BE.20909>