On Tue, March 8, 2011 10:52, Antoine Jacoutot wrote:
> On Tue, 8 Mar 2011, Kirill Bychkov wrote:
>
>> Hi.
>> This diff adds rc script, removes snmp flavor, which is marked as
>> obsolete upstream and doesn't build.
>>
>> Could it go in now?
>
> Hi.
>
> As a general rule when adding rc.d(8) scripts please make sure (and
> mention it) that all rc actions were tested correctly. That is rc_start
> rc_check rc_stop rc_restart and what most people forget, rc_reload.
> I see no mention in the man page about apcupsd supporting a SIGHUP to
> reload its configuration (maybe I just missed it I don't know).

I'll do some extra tests to be sure everything is OK. Thanks for pointing that.

> So please people when you post rc scripts, be more verbose about the
> tests you did.
>
> Thanks.
>
>
>> Index: Makefile
>> ===================================================================
>> RCS file: /cvs/ports/sysutils/apcupsd/Makefile,v
>> retrieving revision 1.10
>> diff -u -p -r1.10 Makefile
>> --- Makefile 7 Mar 2011 18:54:51 -0000       1.10
>> +++ Makefile 8 Mar 2011 07:35:13 -0000
>> @@ -6,7 +6,7 @@ COMMENT-x11 =                gapcmon - GUI for apcupsd
>>
>>  DISTNAME =          apcupsd-3.14.8
>>  PKGNAME-main =              ${DISTNAME}
>> -REVISION-main =     2
>> +REVISION-main =     3
>>  PKGNAME-cgi =               ${DISTNAME:S/-/-cgi-/}
>>  PKGNAME-x11 =               ${DISTNAME:S/-/-x11-/}
>>  REVISION-x11 =              1
>> @@ -47,7 +47,6 @@ CONFIGURE_ARGS =   --mandir=${PREFIX}/man
>>                      --enable-usb
>>
>>  PSEUDO_FLAVORS =    no_x11
>> -FLAVORS =           snmp
>>  FLAVOR ?=
>>
>>  MULTI_PACKAGES =    -main
>> @@ -74,12 +73,6 @@ WANTLIB-x11 += gmodule-2.0 gobject-2.0 g
>>  WANTLIB-x11 += m pango-1.0 pangocairo-1.0 pangoft2-1.0 pixman-1 png
>>  WANTLIB-x11 += pthread-stubs xcb-render xcb z ${WANTLIB} c pthread
>>  WANTLIB-x11 += GL X11-xcb Xxf86vm drm xcb-shm
>> -.endif
>> -
>> -.if ${FLAVOR:L:Msnmp}
>> -CONFIGURE_ARGS +=   --enable-net-snmp
>> -LIB_DEPENDS-main += net/net-snmp
>> -WANTLIB-main =              ${WANTLIB} crypto netsnmp
>>  .endif
>>
>>  FAKE_FLAGS =                
>> sysconfdir=${TRUEPREFIX}/share/examples/apcupsd/etc
>> Index: pkg/MESSAGE-main
>> ===================================================================
>> RCS file: /cvs/ports/sysutils/apcupsd/pkg/MESSAGE-main,v
>> retrieving revision 1.3
>> diff -u -p -r1.3 MESSAGE-main
>> --- pkg/MESSAGE-main 17 Jun 2010 18:43:43 -0000      1.3
>> +++ pkg/MESSAGE-main 8 Mar 2011 07:35:13 -0000
>> @@ -1,10 +1,3 @@
>> -To start apcupsd at boot time, edit ${SYSCONFDIR}/apcupsd/apcupsd.conf
>> -and add the following lines to /etc/rc.local:
>> -
>> -if [ -x ${PREFIX}/sbin/apcupsd ]; then
>> -    echo -n ' apcupsd';       ${PREFIX}/sbin/apcupsctl start
>> -fi
>> -
>>  To allow the system to be fully powered down (in order to preserve
>>  UPS battery), add the following lines to /etc/rc.shutdown:
>>
>> Index: pkg/PLIST-main
>> ===================================================================
>> RCS file: /cvs/ports/sysutils/apcupsd/pkg/PLIST-main,v
>> retrieving revision 1.1.1.1
>> diff -u -p -r1.1.1.1 PLIST-main
>> --- pkg/PLIST-main   25 May 2010 21:56:33 -0000      1.1.1.1
>> +++ pkg/PLIST-main   8 Mar 2011 07:35:13 -0000
>> @@ -1,4 +1,5 @@
>>  @comment $OpenBSD: PLIST-main,v 1.1.1.1 2010/05/25 21:56:33 sthen Exp $
>> +@pkgpath sysutils/apcupsd,snmp
>>  @group bin
>>  @man man/man5/apcupsd.conf.5
>>  @man man/man8/apcaccess.8
>> @@ -82,3 +83,4 @@ share/examples/apcupsd/status/SmartUPS70
>>  share/examples/apcupsd/status/SmartUPS700.status
>>  share/examples/apcupsd/status/newbackupspro1.status
>>  share/examples/apcupsd/status/newbackupspro2.status
>> +@rcscript ${RCDIR}/apcupsd
>> Index: pkg/apcupsd.rc
>> ===================================================================
>> RCS file: pkg/apcupsd.rc
>> diff -N pkg/apcupsd.rc
>> --- /dev/null        1 Jan 1970 00:00:00 -0000
>> +++ pkg/apcupsd.rc   8 Mar 2011 07:35:13 -0000
>> @@ -0,0 +1,14 @@
>> +#!/bin/sh
>> +#
>> +# $OpenBSD$
>> +
>> +daemon=${TRUEPREFIX}/sbin/apcupsd
>> +daemon_flags="-k"
>> +
>> +. /etc/rc.d/rc.subr
>> +
>> +rc_pre() {
>> +    rm -f ${SYSCONFDIR}/apcupsd/powerfail
>> +}
>> +
>> +rc_cmd $1
>>
>>
>>
>
> --
> Antoine
>
>


Reply via email to