[UPDATE] iodine 0.5.2 -> 0.6.0-rc1

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[UPDATE] iodine 0.5.2 -> 0.6.0-rc1

William Orr-2
Update to iodine.
Tested on i386.

* Added rc script

Thoughts? Ok?

Index: net/iodine/Makefile
===================================================================
RCS file: /cvs/ports/net/iodine/Makefile,v
retrieving revision 1.11
diff -N -u net/iodine/Makefile
--- net/iodine/Makefile 3 Dec 2010 07:47:44 -0000       1.11
+++ net/iodine/Makefile 22 Feb 2011 03:59:02 -0000
@@ -2,7 +2,7 @@

 COMMENT=               tunnel IPv4 data through DNS

-DISTNAME=              iodine-0.5.2
+DISTNAME=              iodine-0.6.0-rc1
 REVISION=              0
 CATEGORIES=            net

Index: net/iodine/distinfo
===================================================================
RCS file: /cvs/ports/net/iodine/distinfo,v
retrieving revision 1.3
diff -N -u net/iodine/distinfo
--- net/iodine/distinfo 2 Jun 2009 06:27:05 -0000       1.3
+++ net/iodine/distinfo 22 Feb 2011 03:59:02 -0000
@@ -1,5 +1,5 @@
-MD5 (iodine-0.5.2.tar.gz) = aVI0PMRhSFf4PbuBJHhx5w==
-RMD160 (iodine-0.5.2.tar.gz) = LA1VIzwqYVeRGluGi8U40nwesIU=
-SHA1 (iodine-0.5.2.tar.gz) = KNDQDlE+IKp/38xhhy3uDsAy8RI=
-SHA256 (iodine-0.5.2.tar.gz) = y8FGZdMlY0MY69b3kvjcIikQG9WlUjJCBXBThhL2peQ=
-SIZE (iodine-0.5.2.tar.gz) = 50788
+MD5 (iodine-0.6.0-rc1.tar.gz) = oVu0+roCDSFwFv3m4jEHSg==
+RMD160 (iodine-0.6.0-rc1.tar.gz) = aXS+rCjgewwoDXCV8V0TaZ6crWU=
+SHA1 (iodine-0.6.0-rc1.tar.gz) = T6miSLioTfinJ6XXSeZp5YE27co=
+SHA256 (iodine-0.6.0-rc1.tar.gz) = 2s+VAZi2j9Ha4J/pgAgBVbDHVxj1gcCOBp7uDBtsXmA=
+SIZE (iodine-0.6.0-rc1.tar.gz) = 89827
? net/iodine/patches/patch-man_iodine_8
Index: net/iodine/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/iodine/pkg/PLIST,v
retrieving revision 1.3
diff -N -u net/iodine/pkg/PLIST
--- net/iodine/pkg/PLIST        30 Mar 2009 09:17:45 -0000      1.3
+++ net/iodine/pkg/PLIST        22 Feb 2011 03:59:02 -0000
@@ -4,3 +4,4 @@
 @man man/man8/iodine.8
 @bin sbin/iodine
 @bin sbin/iodined
+@rcscript ${RCDIR}/iodined
Index: net/iodine/pkg/iodined.rc
===================================================================
RCS file: net/iodine/pkg/iodined.rc
diff -N -u net/iodine/pkg/iodined.rc
--- /dev/null   21 Feb 2011 20:59:02 -0000
+++ net/iodine/pkg/iodined.rc   22 Feb 2011 03:59:02 -0000
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. /etc/rc.d/rc.subr
+
+daemon=/usr/local/sbin/iodined
+
+rc_reload() {
+    rc_err "$0: reload not supported"
+}
+
+rc_stop() {
+    pkill iodined
+}
+
+rc_cmd $1


--
-Will Orr

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

Brad Smith-14
On 21/02/11 11:02 PM, William Orr wrote:
> Update to iodine.
> Tested on i386.
>
> * Added rc script
>
> Thoughts? Ok?

Generally speaking a release candidate version wouldn't
be commited to the ports tree and your diff is missing a
local patch it looks like you forgot to cvs add...

? net/iodine/patches/patch-man_iodine_8

Wait for the final release before posting the update.


> Index: net/iodine/Makefile
> ===================================================================
> RCS file: /cvs/ports/net/iodine/Makefile,v
> retrieving revision 1.11
> diff -N -u net/iodine/Makefile
> --- net/iodine/Makefile 3 Dec 2010 07:47:44 -0000       1.11
> +++ net/iodine/Makefile 22 Feb 2011 03:59:02 -0000
> @@ -2,7 +2,7 @@
>
>   COMMENT=               tunnel IPv4 data through DNS
>
> -DISTNAME=              iodine-0.5.2
> +DISTNAME=              iodine-0.6.0-rc1
>   REVISION=              0
>   CATEGORIES=            net
>
> Index: net/iodine/distinfo
> ===================================================================
> RCS file: /cvs/ports/net/iodine/distinfo,v
> retrieving revision 1.3
> diff -N -u net/iodine/distinfo
> --- net/iodine/distinfo 2 Jun 2009 06:27:05 -0000       1.3
> +++ net/iodine/distinfo 22 Feb 2011 03:59:02 -0000
> @@ -1,5 +1,5 @@
> -MD5 (iodine-0.5.2.tar.gz) = aVI0PMRhSFf4PbuBJHhx5w==
> -RMD160 (iodine-0.5.2.tar.gz) = LA1VIzwqYVeRGluGi8U40nwesIU=
> -SHA1 (iodine-0.5.2.tar.gz) = KNDQDlE+IKp/38xhhy3uDsAy8RI=
> -SHA256 (iodine-0.5.2.tar.gz) = y8FGZdMlY0MY69b3kvjcIikQG9WlUjJCBXBThhL2peQ=
> -SIZE (iodine-0.5.2.tar.gz) = 50788
> +MD5 (iodine-0.6.0-rc1.tar.gz) = oVu0+roCDSFwFv3m4jEHSg==
> +RMD160 (iodine-0.6.0-rc1.tar.gz) = aXS+rCjgewwoDXCV8V0TaZ6crWU=
> +SHA1 (iodine-0.6.0-rc1.tar.gz) = T6miSLioTfinJ6XXSeZp5YE27co=
> +SHA256 (iodine-0.6.0-rc1.tar.gz) = 2s+VAZi2j9Ha4J/pgAgBVbDHVxj1gcCOBp7uDBtsXmA=
> +SIZE (iodine-0.6.0-rc1.tar.gz) = 89827
> ? net/iodine/patches/patch-man_iodine_8
> Index: net/iodine/pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/net/iodine/pkg/PLIST,v
> retrieving revision 1.3
> diff -N -u net/iodine/pkg/PLIST
> --- net/iodine/pkg/PLIST        30 Mar 2009 09:17:45 -0000      1.3
> +++ net/iodine/pkg/PLIST        22 Feb 2011 03:59:02 -0000
> @@ -4,3 +4,4 @@
>   @man man/man8/iodine.8
>   @bin sbin/iodine
>   @bin sbin/iodined
> +@rcscript ${RCDIR}/iodined
> Index: net/iodine/pkg/iodined.rc
> ===================================================================
> RCS file: net/iodine/pkg/iodined.rc
> diff -N -u net/iodine/pkg/iodined.rc
> --- /dev/null   21 Feb 2011 20:59:02 -0000
> +++ net/iodine/pkg/iodined.rc   22 Feb 2011 03:59:02 -0000
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +
> +. /etc/rc.d/rc.subr
> +
> +daemon=/usr/local/sbin/iodined
> +
> +rc_reload() {
> +    rc_err "$0: reload not supported"
> +}
> +
> +rc_stop() {
> +    pkill iodined
> +}
> +
> +rc_cmd $1
>
>


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

William Orr-2
On Mon, Feb 21, 2011 at 11:09 PM, Brad <[hidden email]> wrote:

> On 21/02/11 11:02 PM, William Orr wrote:
>>
>> Update to iodine.
>> Tested on i386.
>>
>> * Added rc script
>>
>> Thoughts? Ok?
>
> Generally speaking a release candidate version wouldn't
> be commited to the ports tree and your diff is missing a
> local patch it looks like you forgot to cvs add...
>
> ? net/iodine/patches/patch-man_iodine_8
>
> Wait for the final release before posting the update.
>
>
>> Index: net/iodine/Makefile
>> ===================================================================
>> RCS file: /cvs/ports/net/iodine/Makefile,v
>> retrieving revision 1.11
>> diff -N -u net/iodine/Makefile
>> --- net/iodine/Makefile 3 Dec 2010 07:47:44 -0000       1.11
>> +++ net/iodine/Makefile 22 Feb 2011 03:59:02 -0000
>> @@ -2,7 +2,7 @@
>>
>>  COMMENT=               tunnel IPv4 data through DNS
>>
>> -DISTNAME=              iodine-0.5.2
>> +DISTNAME=              iodine-0.6.0-rc1
>>  REVISION=              0
>>  CATEGORIES=            net
>>
>> Index: net/iodine/distinfo
>> ===================================================================
>> RCS file: /cvs/ports/net/iodine/distinfo,v
>> retrieving revision 1.3
>> diff -N -u net/iodine/distinfo
>> --- net/iodine/distinfo 2 Jun 2009 06:27:05 -0000       1.3
>> +++ net/iodine/distinfo 22 Feb 2011 03:59:02 -0000
>> @@ -1,5 +1,5 @@
>> -MD5 (iodine-0.5.2.tar.gz) = aVI0PMRhSFf4PbuBJHhx5w==
>> -RMD160 (iodine-0.5.2.tar.gz) = LA1VIzwqYVeRGluGi8U40nwesIU=
>> -SHA1 (iodine-0.5.2.tar.gz) = KNDQDlE+IKp/38xhhy3uDsAy8RI=
>> -SHA256 (iodine-0.5.2.tar.gz) =
>> y8FGZdMlY0MY69b3kvjcIikQG9WlUjJCBXBThhL2peQ=
>> -SIZE (iodine-0.5.2.tar.gz) = 50788
>> +MD5 (iodine-0.6.0-rc1.tar.gz) = oVu0+roCDSFwFv3m4jEHSg==
>> +RMD160 (iodine-0.6.0-rc1.tar.gz) = aXS+rCjgewwoDXCV8V0TaZ6crWU=
>> +SHA1 (iodine-0.6.0-rc1.tar.gz) = T6miSLioTfinJ6XXSeZp5YE27co=
>> +SHA256 (iodine-0.6.0-rc1.tar.gz) =
>> 2s+VAZi2j9Ha4J/pgAgBVbDHVxj1gcCOBp7uDBtsXmA=
>> +SIZE (iodine-0.6.0-rc1.tar.gz) = 89827
>> ? net/iodine/patches/patch-man_iodine_8
>> Index: net/iodine/pkg/PLIST
>> ===================================================================
>> RCS file: /cvs/ports/net/iodine/pkg/PLIST,v
>> retrieving revision 1.3
>> diff -N -u net/iodine/pkg/PLIST
>> --- net/iodine/pkg/PLIST        30 Mar 2009 09:17:45 -0000      1.3
>> +++ net/iodine/pkg/PLIST        22 Feb 2011 03:59:02 -0000
>> @@ -4,3 +4,4 @@
>>  @man man/man8/iodine.8
>>  @bin sbin/iodine
>>  @bin sbin/iodined
>> +@rcscript ${RCDIR}/iodined
>> Index: net/iodine/pkg/iodined.rc
>> ===================================================================
>> RCS file: net/iodine/pkg/iodined.rc
>> diff -N -u net/iodine/pkg/iodined.rc
>> --- /dev/null   21 Feb 2011 20:59:02 -0000
>> +++ net/iodine/pkg/iodined.rc   22 Feb 2011 03:59:02 -0000
>> @@ -0,0 +1,15 @@
>> +#!/bin/sh
>> +
>> +. /etc/rc.d/rc.subr
>> +
>> +daemon=/usr/local/sbin/iodined
>> +
>> +rc_reload() {
>> +    rc_err "$0: reload not supported"
>> +}
>> +
>> +rc_stop() {
>> +    pkill iodined
>> +}
>> +
>> +rc_cmd $1
>>
>>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>

Sorry about the missing file, I'm new to cvs. Been using git for so long...

Here is a revised patch that adds an rcscript, as well as updating the
manpage to document the OpenBSD defaults for certain values.

Index: ports/net/iodine/patches/patch-man_iodine_8
===================================================================
RCS file: ports/net/iodine/patches/patch-man_iodine_8
diff -N -u ports/net/iodine/patches/patch-man_iodine_8
--- /dev/null   21 Feb 2011 21:43:34 -0000
+++ ports/net/iodine/patches/patch-man_iodine_8 22 Feb 2011 04:43:34 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- man/iodine.8.orig  Tue Jan  4 21:00:27 2011
++++ man/iodine.8       Tue Jan  4 21:01:53 2011
+@@ -103,10 +103,10 @@ Print usage info and exit.
+ Keep running in foreground.
+ .TP
+ .B -u user
+-Drop privileges and run as user 'user' after setting up tunnel.
++Drop privileges and run as user 'user' after setting up tunnel.
Default is _iodine.
+ .TP
+ .B -t chrootdir
+-Chroot to 'chrootdir' after setting up tunnel.
++Chroot to 'chrootdir' after setting up tunnel. Default is /var/empty.
+ .TP
+ .B -d device
+ Use the TUN device 'device' instead of the normal one, which is dnsX on Linux
Index: ports/net/iodine/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/iodine/pkg/PLIST,v
retrieving revision 1.3
diff -N -u ports/net/iodine/pkg/PLIST
--- ports/net/iodine/pkg/PLIST  30 Mar 2009 09:17:45 -0000      1.3
+++ ports/net/iodine/pkg/PLIST  22 Feb 2011 04:43:34 -0000
@@ -4,3 +4,4 @@
 @man man/man8/iodine.8
 @bin sbin/iodine
 @bin sbin/iodined
+@rcscript ${RCDIR}/iodined
Index: ports/net/iodine/pkg/iodined.rc
===================================================================
RCS file: ports/net/iodine/pkg/iodined.rc
diff -N -u ports/net/iodine/pkg/iodined.rc
--- /dev/null   21 Feb 2011 21:43:34 -0000
+++ ports/net/iodine/pkg/iodined.rc     22 Feb 2011 04:43:34 -0000
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. /etc/rc.d/rc.subr
+
+daemon=/usr/local/sbin/iodined
+
+rc_reload() {
+    rc_err "$0: reload not supported"
+}
+
+rc_stop() {
+    pkill iodined
+}
+
+rc_cmd $1


--
-Will Orr

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

Antoine Jacoutot-7
 On Mon, 21 Feb 2011 23:48:50 -0500, William Orr wrote:
> On Mon, Feb 21, 2011 at 11:09 PM, Brad <[hidden email]> wrote:
>> On 21/02/11 11:02 PM, William Orr wrote:
>>>
>>> Update to iodine.
>>> Tested on i386.
>>>
>>> * Added rc script

 You rc script is completely bogus.
 Read rc.subr(8) and rc.d(8) and look at other ports rc scripts for
 examples.

--
 Antoine

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

William Orr-2
On Tue, Feb 22, 2011 at 2:31 AM, Antoine Jacoutot <[hidden email]> wrote:

> On Mon, 21 Feb 2011 23:48:50 -0500, William Orr wrote:
>>
>> On Mon, Feb 21, 2011 at 11:09 PM, Brad <[hidden email]> wrote:
>>>
>>> On 21/02/11 11:02 PM, William Orr wrote:
>>>>
>>>> Update to iodine.
>>>> Tested on i386.
>>>>
>>>> * Added rc script
>
> You rc script is completely bogus.
> Read rc.subr(8) and rc.d(8) and look at other ports rc scripts for examples.
>
> --
> Antoine
>
>

RCS file: net/iodine/patches/patch-man_iodine_8
diff -N net/iodine/patches/patch-man_iodine_8
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/iodine/patches/patch-man_iodine_8       22 Feb 2011 04:43:52 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- man/iodine.8.orig  Tue Jan  4 21:00:27 2011
++++ man/iodine.8       Tue Jan  4 21:01:53 2011
+@@ -103,10 +103,10 @@ Print usage info and exit.
+ Keep running in foreground.
+ .TP
+ .B -u user
+-Drop privileges and run as user 'user' after setting up tunnel.
++Drop privileges and run as user 'user' after setting up tunnel.
Default is _iodine.
+ .TP
+ .B -t chrootdir
+-Chroot to 'chrootdir' after setting up tunnel.
++Chroot to 'chrootdir' after setting up tunnel. Default is /var/empty.
+ .TP
+ .B -d device
+ Use the TUN device 'device' instead of the normal one, which is dnsX on Linux
cvs diff: Diffing net/iodine/pkg
Index: net/iodine/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/iodine/pkg/PLIST,v
retrieving revision 1.3
diff -u -r1.3 PLIST
--- net/iodine/pkg/PLIST        30 Mar 2009 09:17:45 -0000      1.3
+++ net/iodine/pkg/PLIST        22 Feb 2011 04:45:28 -0000
@@ -4,3 +4,4 @@
 @man man/man8/iodine.8
 @bin sbin/iodine
 @bin sbin/iodined
+@rcscript ${RCDIR}/iodined
Index: net/iodine/pkg/iodined.rc
===================================================================
RCS file: net/iodine/pkg/iodined.rc
diff -N net/iodine/pkg/iodined.rc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/iodine/pkg/iodined.rc   23 Feb 2011 14:32:46 -0000
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+daemon=/usr/local/sbin/iodined
+pexp=${daemon}
+
+. /etc/rc.d/rc.subr
+
+rc_cmd $1

I think I got it now. I wrote that rc script a few months ago, and it
looks like rc.subr (as well as /etc/rc.d/mysqld - the model I've been
using) has changed a lot since then!

Thanks for the help and patience.

--
-Will Orr

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

David Coppa
On Wed, Feb 23, 2011 at 3:52 PM, William Orr <[hidden email]> wrote:

> Index: net/iodine/pkg/iodined.rc
> ===================================================================
> RCS file: net/iodine/pkg/iodined.rc
> diff -N net/iodine/pkg/iodined.rc
> --- /dev/null   1 Jan 1970 00:00:00 -0000
> +++ net/iodine/pkg/iodined.rc   23 Feb 2011 14:32:46 -0000
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +
> +daemon=/usr/local/sbin/iodined
> +pexp=${daemon}
> +
> +. /etc/rc.d/rc.subr
> +
> +rc_cmd $1
>
> I think I got it now. I wrote that rc script a few months ago, and it
> looks like rc.subr (as well as /etc/rc.d/mysqld - the model I've been
> using) has changed a lot since then!

"pexp=${daemon}" is useless.

Ciao,
David

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

William Orr-2
On Wed, Feb 23, 2011 at 9:59 AM, David Coppa <[hidden email]> wrote:

> On Wed, Feb 23, 2011 at 3:52 PM, William Orr <[hidden email]> wrote:
>
>> Index: net/iodine/pkg/iodined.rc
>> ===================================================================
>> RCS file: net/iodine/pkg/iodined.rc
>> diff -N net/iodine/pkg/iodined.rc
>> --- /dev/null   1 Jan 1970 00:00:00 -0000
>> +++ net/iodine/pkg/iodined.rc   23 Feb 2011 14:32:46 -0000
>> @@ -0,0 +1,8 @@
>> +#!/bin/sh
>> +
>> +daemon=/usr/local/sbin/iodined
>> +pexp=${daemon}
>> +
>> +. /etc/rc.d/rc.subr
>> +
>> +rc_cmd $1
>>
>> I think I got it now. I wrote that rc script a few months ago, and it
>> looks like rc.subr (as well as /etc/rc.d/mysqld - the model I've been
>> using) has changed a lot since then!
>
> "pexp=${daemon}" is useless.
>
> Ciao,
> David
>

Not in this case. The problem arises when you pass the a password as
an argument to iodined. When you view/pgrep the process list, it
doesn't show that argument, so pgrep -f '^${daemon}${daemon_flags}'
fails when the user sets a password.

--
-Will Orr

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

David Coppa
On Wed, Feb 23, 2011 at 4:16 PM, William Orr <[hidden email]> wrote:

> Not in this case. The problem arises when you pass the a password as
> an argument to iodined. When you view/pgrep the process list, it
> doesn't show that argument, so pgrep -f '^${daemon}${daemon_flags}'
> fails when the user sets a password.

Ah... Ok, then ;)

ciao,
david

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

Ingo Schwarze
In reply to this post by William Orr-2
Hi Will,

> Index: net/iodine/pkg/iodined.rc
> ===================================================================
> RCS file: net/iodine/pkg/iodined.rc
> diff -N net/iodine/pkg/iodined.rc
> --- /dev/null   1 Jan 1970 00:00:00 -0000
> +++ net/iodine/pkg/iodined.rc   23 Feb 2011 14:32:46 -0000
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +
> +daemon=/usr/local/sbin/iodined
> +pexp=${daemon}
> +
> +. /etc/rc.d/rc.subr
> +
> +rc_cmd $1

pexp must be defined *after* sourcing rc.subr, or it will be overwritten.
However, "${daemon} ${daemon_flags}" is the default, or just "${daemon}"
when ${daemon_flags} is unset, so you should not set it at all.

See rc.subr(8) for details.

> I think I got it now. I wrote that rc script a few months ago, and it
> looks like rc.subr (as well as /etc/rc.d/mysqld - the model I've been
> using) has changed a lot since then!

Indeed, rc.d was born in Budapest less than half a year ago.
The interface was only stabilized for the upcoming 4.9 release.

Yours,
  Ingo

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

William Orr-2
On Wed, Feb 23, 2011 at 10:23 AM, Ingo Schwarze <[hidden email]> wrote:

> Hi Will,
>
>> Index: net/iodine/pkg/iodined.rc
>> ===================================================================
>> RCS file: net/iodine/pkg/iodined.rc
>> diff -N net/iodine/pkg/iodined.rc
>> --- /dev/null   1 Jan 1970 00:00:00 -0000
>> +++ net/iodine/pkg/iodined.rc   23 Feb 2011 14:32:46 -0000
>> @@ -0,0 +1,8 @@
>> +#!/bin/sh
>> +
>> +daemon=/usr/local/sbin/iodined
>> +pexp=${daemon}
>> +
>> +. /etc/rc.d/rc.subr
>> +
>> +rc_cmd $1
>
> pexp must be defined *after* sourcing rc.subr, or it will be overwritten.
> However, "${daemon} ${daemon_flags}" is the default, or just "${daemon}"
> when ${daemon_flags} is unset, so you should not set it at all.
>
> See rc.subr(8) for details.
>
>> I think I got it now. I wrote that rc script a few months ago, and it
>> looks like rc.subr (as well as /etc/rc.d/mysqld - the model I've been
>> using) has changed a lot since then!
>
> Indeed, rc.d was born in Budapest less than half a year ago.
> The interface was only stabilized for the upcoming 4.9 release.
>
> Yours,
>  Ingo
>

In rc.subr (or at least the one in -current), it checks for the
existence of $pexp before setting it. Should I not expect that
behavior?

--
-Will Orr

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

Ingo Schwarze
Hi Will,

William Orr wrote on Wed, Feb 23, 2011 at 10:34:14AM -0500:
> On Wed, Feb 23, 2011 at 10:23 AM, Ingo Schwarze <[hidden email]> wrote:
>> William Orr wrote:

>>> Index: net/iodine/pkg/iodined.rc
>>> ===================================================================
>>> RCS file: net/iodine/pkg/iodined.rc
>>> diff -N net/iodine/pkg/iodined.rc
>>> --- /dev/null   1 Jan 1970 00:00:00 -0000
>>> +++ net/iodine/pkg/iodined.rc   23 Feb 2011 14:32:46 -0000
>>> @@ -0,0 +1,8 @@
>>> +#!/bin/sh
>>> +
>>> +daemon=/usr/local/sbin/iodined
>>> +pexp=${daemon}
>>> +
>>> +. /etc/rc.d/rc.subr
>>> +
>>> +rc_cmd $1

>> pexp must be defined *after* sourcing rc.subr, or it will be overwritten.

That part is correct.

>> However, "${daemon} ${daemon_flags}" is the default, or just "${daemon}"
>> when ${daemon_flags} is unset, so you should not set it at all.

Sorry, that part was bad advice.  As dcoppa@ and ajacoutot@ observed
as well, in this particular case, putting "pexp=${daemon}" makes
sense because the user might set iodine_flags in rc.conf.local(8).

> In rc.subr (or at least the one in -current), it checks for the
> existence of $pexp before setting it.

It does not, see

  http://www.openbsd.org/cgi-bin/cvsweb/src/etc/rc.d/rc.subr?rev=1.20

The second line from the bottom is an unconditional

  pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"

That will override whatever you set before.

Yours,
  Ingo

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

William Orr-2
On Sun, Feb 27, 2011 at 9:06 AM, Ingo Schwarze <[hidden email]> wrote:

> Hi Will,
>
> William Orr wrote on Wed, Feb 23, 2011 at 10:34:14AM -0500:
>> On Wed, Feb 23, 2011 at 10:23 AM, Ingo Schwarze <[hidden email]> wrote:
>>> William Orr wrote:
>
>>>> Index: net/iodine/pkg/iodined.rc
>>>> ===================================================================
>>>> RCS file: net/iodine/pkg/iodined.rc
>>>> diff -N net/iodine/pkg/iodined.rc
>>>> --- /dev/null   1 Jan 1970 00:00:00 -0000
>>>> +++ net/iodine/pkg/iodined.rc   23 Feb 2011 14:32:46 -0000
>>>> @@ -0,0 +1,8 @@
>>>> +#!/bin/sh
>>>> +
>>>> +daemon=/usr/local/sbin/iodined
>>>> +pexp=${daemon}
>>>> +
>>>> +. /etc/rc.d/rc.subr
>>>> +
>>>> +rc_cmd $1
>
>>> pexp must be defined *after* sourcing rc.subr, or it will be overwritten.
>
> That part is correct.
>
>>> However, "${daemon} ${daemon_flags}" is the default, or just "${daemon}"
>>> when ${daemon_flags} is unset, so you should not set it at all.
>
> Sorry, that part was bad advice.  As dcoppa@ and ajacoutot@ observed
> as well, in this particular case, putting "pexp=${daemon}" makes
> sense because the user might set iodine_flags in rc.conf.local(8).
>
>> In rc.subr (or at least the one in -current), it checks for the
>> existence of $pexp before setting it.
>
> It does not, see
>
>  http://www.openbsd.org/cgi-bin/cvsweb/src/etc/rc.d/rc.subr?rev=1.20
>
> The second line from the bottom is an unconditional
>
>  pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"
>
> That will override whatever you set before.
>
> Yours,
>  Ingo
>

Thanks so much for your help, guys. Here's the latest patch, with the
change to the rc script. I also bumped the revision number.

Let me know if there are any more problems with it.

Thanks!


Index: net/iodine/Makefile
===================================================================
RCS file: /cvs/ports/net/iodine/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- net/iodine/Makefile 3 Dec 2010 07:47:44 -0000   1.11
+++ net/iodine/Makefile 28 Feb 2011 01:43:21 -0000
@@ -3,7 +3,7 @@
 COMMENT=       tunnel IPv4 data through DNS

 DISTNAME=      iodine-0.5.2
-REVISION=      0
+REVISION=      1
 CATEGORIES=        net

 HOMEPAGE=      http://code.kryo.se/iodine/
Index: net/iodine/patches/patch-man_iodine_8
===================================================================
RCS file: net/iodine/patches/patch-man_iodine_8
diff -N net/iodine/patches/patch-man_iodine_8
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/iodine/patches/patch-man_iodine_8   22 Feb 2011 04:43:52 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- man/iodine.8.orig  Tue Jan  4 21:00:27 2011
++++ man/iodine.8   Tue Jan  4 21:01:53 2011
+@@ -103,10 +103,10 @@ Print usage info and exit.
+ Keep running in foreground.
+ .TP
+ .B -u user
+-Drop privileges and run as user 'user' after setting up tunnel.
++Drop privileges and run as user 'user' after setting up tunnel.
Default is _iodine.
+ .TP
+ .B -t chrootdir
+-Chroot to 'chrootdir' after setting up tunnel.
++Chroot to 'chrootdir' after setting up tunnel. Default is /var/empty.
+ .TP
+ .B -d device
+ Use the TUN device 'device' instead of the normal one, which is dnsX on Linux
Index: net/iodine/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/iodine/pkg/PLIST,v
retrieving revision 1.3
diff -u -r1.3 PLIST
--- net/iodine/pkg/PLIST    30 Mar 2009 09:17:45 -0000  1.3
+++ net/iodine/pkg/PLIST    22 Feb 2011 04:45:28 -0000
@@ -4,3 +4,4 @@
 @man man/man8/iodine.8
 @bin sbin/iodine
 @bin sbin/iodined
+@rcscript ${RCDIR}/iodined
Index: net/iodine/pkg/iodined.rc
===================================================================
RCS file: net/iodine/pkg/iodined.rc
diff -N net/iodine/pkg/iodined.rc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/iodine/pkg/iodined.rc   28 Feb 2011 01:49:58 -0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+daemon=/usr/local/sbin/iodined
+
+. /etc/rc.d/rc.subr
+
+pexp=${daemon}
+
+rc_cmd $1


--
-Will Orr

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

Antoine Jacoutot-7
On Sun, 27 Feb 2011, William Orr wrote:

> Index: net/iodine/pkg/iodined.rc
> ===================================================================
> RCS file: net/iodine/pkg/iodined.rc
> diff -N net/iodine/pkg/iodined.rc
> --- /dev/null   1 Jan 1970 00:00:00 -0000
> +++ net/iodine/pkg/iodined.rc   28 Feb 2011 01:49:58 -0000
> @@ -0,0 +1,9 @@
> +#!/bin/sh
> +
> +daemon=/usr/local/sbin/iodined

Please don't hardcode /usr/local here.

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] iodine 0.5.2 -> 0.6.0-rc1

William Orr-2
On Mon, Feb 28, 2011 at 1:30 AM, Antoine Jacoutot <[hidden email]> wrote:

> On Sun, 27 Feb 2011, William Orr wrote:
>
>> Index: net/iodine/pkg/iodined.rc
>> ===================================================================
>> RCS file: net/iodine/pkg/iodined.rc
>> diff -N net/iodine/pkg/iodined.rc
>> --- /dev/null   1 Jan 1970 00:00:00 -0000
>> +++ net/iodine/pkg/iodined.rc   28 Feb 2011 01:49:58 -0000
>> @@ -0,0 +1,9 @@
>> +#!/bin/sh
>> +
>> +daemon=/usr/local/sbin/iodined
>
> Please don't hardcode /usr/local here.
>
> --
> Antoine
>

Ok, fixed that. Should that be documented in rc.subr(8)? Or is it
already documented in some other manpage that I'm not aware of?

Index: net/iodine/Makefile
===================================================================
RCS file: /cvs/ports/net/iodine/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- net/iodine/Makefile 3 Dec 2010 07:47:44 -0000   1.11
+++ net/iodine/Makefile 28 Feb 2011 01:43:21 -0000
@@ -3,7 +3,7 @@
 COMMENT=       tunnel IPv4 data through DNS

 DISTNAME=      iodine-0.5.2
-REVISION=      0
+REVISION=      1
 CATEGORIES=        net

 HOMEPAGE=      http://code.kryo.se/iodine/
Index: net/iodine/patches/patch-man_iodine_8
===================================================================
RCS file: net/iodine/patches/patch-man_iodine_8
diff -N net/iodine/patches/patch-man_iodine_8
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/iodine/patches/patch-man_iodine_8   22 Feb 2011 04:43:52 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- man/iodine.8.orig  Tue Jan  4 21:00:27 2011
++++ man/iodine.8   Tue Jan  4 21:01:53 2011
+@@ -103,10 +103,10 @@ Print usage info and exit.
+ Keep running in foreground.
+ .TP
+ .B -u user
+-Drop privileges and run as user 'user' after setting up tunnel.
++Drop privileges and run as user 'user' after setting up tunnel.
Default is _iodine.
+ .TP
+ .B -t chrootdir
+-Chroot to 'chrootdir' after setting up tunnel.
++Chroot to 'chrootdir' after setting up tunnel. Default is /var/empty.
+ .TP
+ .B -d device
+ Use the TUN device 'device' instead of the normal one, which is dnsX on Linux
Index: net/iodine/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/iodine/pkg/PLIST,v
retrieving revision 1.3
diff -u -r1.3 PLIST
--- net/iodine/pkg/PLIST    30 Mar 2009 09:17:45 -0000  1.3
+++ net/iodine/pkg/PLIST    22 Feb 2011 04:45:28 -0000
@@ -4,3 +4,4 @@
 @man man/man8/iodine.8
 @bin sbin/iodine
 @bin sbin/iodined
+@rcscript ${RCDIR}/iodined
Index: net/iodine/pkg/iodined.rc
===================================================================
RCS file: net/iodine/pkg/iodined.rc
diff -N net/iodine/pkg/iodined.rc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/iodine/pkg/iodined.rc   28 Feb 2011 08:24:58 -0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+daemon="${TRUEPREFIX}/sbin/iodined"
+
+. /etc/rc.d/rc.subr
+
+pexp=${daemon}



--
-Will Orr