Re: [UPDATE] polipo patch rcscript

2010-11-03 Thread Matthias Kilian
Hi,

On Tue, Nov 02, 2010 at 12:05:40AM +0100, Jiri B. wrote:
 - patch-config.sample to be more clear that it is dir in
   /var/log

But it isn't a directory, it's just a plain file /var/log/polipo.
Or am I missing something?

 - rcscript
 - removing MESSAGE, I think it's useless with rcscript

Those two are fine. I'll also bump REVISION before committing it.

Ciao,
Kili



Re: [UPDATE] polipo patch rcscript

2010-11-03 Thread Matthias Kilian
On Wed, Nov 03, 2010 at 06:02:21PM +0100, Matthias Kilian wrote:
  - rcscript
  - removing MESSAGE, I think it's useless with rcscript
 
 Those two are fine. I'll also bump REVISION before committing it.

Actually, they were *not* fine:

- polipo exits on SIGHUP, so let rc_reload() just call rc_cmd restart
- reset the permissions of ${RCDIR}/polipo in the PLIST.


Index: Makefile
===
RCS file: /cvs/ports/www/polipo/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile26 Oct 2010 15:29:24 -  1.9
+++ Makefile3 Nov 2010 17:32:56 -
@@ -4,7 +4,7 @@ COMMENT=HTTP caching proxy
 
 DISTNAME=  polipo-1.0.4.1
 CATEGORIES=www
-REVISION=  0
+REVISION=  1
 
 HOMEPAGE=  http://www.pps.jussieu.fr/~jch/software/polipo/
 
Index: pkg/MESSAGE
===
RCS file: pkg/MESSAGE
diff -N pkg/MESSAGE
--- pkg/MESSAGE 6 Aug 2005 21:21:53 -   1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,15 +0,0 @@
-When run as the root user, the polipo daemon will drop privileges to
-that of the _polipo user and its login group.
-
-Some sample configuration files have been installed in
-${SYSCONFDIR}/polipo.
-
-Additionally, you may wish to start polipo at system start-up time via
-the /etc/rc.local script.
-
-if [ X${polipo} == XYES -a -x ${PREFIX}/bin/polipo ]; then
-echo -n ' polipo'
-${PREFIX}/bin/polipo daemonise=yes
-fi
-
-and adding polipo=YES to /etc/rc.conf.local
Index: pkg/PLIST
===
RCS file: /cvs/ports/www/polipo/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- pkg/PLIST   3 Feb 2008 15:06:48 -   1.3
+++ pkg/PLIST   3 Nov 2010 17:32:56 -
@@ -1,7 +1,7 @@
 @comment $OpenBSD: PLIST,v 1.3 2008/02/03 15:06:48 kili Exp $
 @newgroup _polipo:548
 @newuser _polipo:548:_polipo:daemon:Polipo Account:/nonexistent:/sbin/nologin
-bin/polipo
+...@bin bin/polipo
 @info info/polipo.info
 @man man/man1/polipo.1
 share/doc/polipo/
@@ -88,3 +88,7 @@ share/examples/polipo/forbidden.sample
 @sample /var/polipo/
 @sample /var/polipo/cache/
 @extraunexec rm -rf /var/polipo/*
+...@mode
+...@owner
+...@group
+...@rcscript ${RCDIR}/polipo
Index: pkg/polipo.rc
===
RCS file: pkg/polipo.rc
diff -N pkg/polipo.rc
--- /dev/null   1 Jan 1970 00:00:00 -
+++ pkg/polipo.rc   3 Nov 2010 17:32:56 -
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# $OpenBSD$
+
+. /etc/rc.d/rc.subr
+
+daemon=/usr/local/bin/polipo
+daemon_flags=daemonise=yes
+
+rc_reload() {
+   rc_cmd restart
+}
+
+rc_cmd $1



Re: [UPDATE] polipo patch rcscript

2010-11-03 Thread Matthias Kilian
On Wed, Nov 03, 2010 at 06:35:22PM +0100, Matthias Kilian wrote:
 - polipo exits on SIGHUP, so let rc_reload() just call rc_cmd restart
[...]
 +rc_reload() {
 + rc_cmd restart
 +}

ajacoutot@ pointed out that this is wrong. rc_reload() should just error
out in this case.


Index: Makefile
===
RCS file: /cvs/ports/www/polipo/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile26 Oct 2010 15:29:24 -  1.9
+++ Makefile3 Nov 2010 18:55:46 -
@@ -4,7 +4,7 @@ COMMENT=HTTP caching proxy
 
 DISTNAME=  polipo-1.0.4.1
 CATEGORIES=www
-REVISION=  0
+REVISION=  1
 
 HOMEPAGE=  http://www.pps.jussieu.fr/~jch/software/polipo/
 
Index: pkg/MESSAGE
===
RCS file: pkg/MESSAGE
diff -N pkg/MESSAGE
--- pkg/MESSAGE 6 Aug 2005 21:21:53 -   1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,15 +0,0 @@
-When run as the root user, the polipo daemon will drop privileges to
-that of the _polipo user and its login group.
-
-Some sample configuration files have been installed in
-${SYSCONFDIR}/polipo.
-
-Additionally, you may wish to start polipo at system start-up time via
-the /etc/rc.local script.
-
-if [ X${polipo} == XYES -a -x ${PREFIX}/bin/polipo ]; then
-echo -n ' polipo'
-${PREFIX}/bin/polipo daemonise=yes
-fi
-
-and adding polipo=YES to /etc/rc.conf.local
Index: pkg/PLIST
===
RCS file: /cvs/ports/www/polipo/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- pkg/PLIST   3 Feb 2008 15:06:48 -   1.3
+++ pkg/PLIST   3 Nov 2010 18:55:46 -
@@ -1,7 +1,7 @@
 @comment $OpenBSD: PLIST,v 1.3 2008/02/03 15:06:48 kili Exp $
 @newgroup _polipo:548
 @newuser _polipo:548:_polipo:daemon:Polipo Account:/nonexistent:/sbin/nologin
-bin/polipo
+...@bin bin/polipo
 @info info/polipo.info
 @man man/man1/polipo.1
 share/doc/polipo/
@@ -88,3 +88,7 @@ share/examples/polipo/forbidden.sample
 @sample /var/polipo/
 @sample /var/polipo/cache/
 @extraunexec rm -rf /var/polipo/*
+...@mode
+...@owner
+...@group
+...@rcscript ${RCDIR}/polipo
Index: pkg/polipo.rc
===
RCS file: pkg/polipo.rc
diff -N pkg/polipo.rc
--- /dev/null   1 Jan 1970 00:00:00 -
+++ pkg/polipo.rc   3 Nov 2010 18:55:46 -
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# $OpenBSD$
+
+. /etc/rc.d/rc.subr
+
+daemon=/usr/local/bin/polipo
+daemon_flags=daemonise=yes
+
+rc_reload() {
+   rc_err $0: reload is not supported
+}
+
+rc_cmd $1



Re: [UPDATE] polipo patch rcscript

2010-11-03 Thread Jiri B.
On Wed, Nov 03, 2010 at 08:00:26PM +0100, Matthias Kilian wrote:
ajacoutot@ pointed out that this is wrong. rc_reload() should just error
out in this case.

Even I did mess I thank you to do it correctly.

Anyway, wouldn't be nice to have a possibility to override signal for
pkill or to extend list for action (ie. slow-stop)? But it would
make rc.d system probably to complicated.

For example:
- polipo (reload-forbids)
- tor (slow-stop)

jirib