On 10/20/2015 04:56 PM, Antoine Jacoutot wrote: > On Tue, Oct 20, 2015 at 03:36:54PM +0200, Alexandre Perrin wrote: >> Attached patch add a rc script for iodined and README to describe the >> rc script configuration. Tested on 5.8-stable amd64. >> >> Ok? >> >> Regards, >> Alexandre Perrin. > >> Index: Makefile >> =================================================================== >> RCS file: /cvs/ports/net/iodine/Makefile,v >> retrieving revision 1.14 >> diff -u -p -r1.14 Makefile >> --- Makefile 19 Jun 2014 22:45:56 -0000 1.14 >> +++ Makefile 20 Oct 2015 13:31:47 -0000 >> @@ -4,6 +4,7 @@ COMMENT= tunnel IPv4 data through DNS >> >> DISTNAME= iodine-0.7.0 >> CATEGORIES= net >> +REVISION= 0 >> >> HOMEPAGE= http://code.kryo.se/iodine/ >> >> Index: pkg/PLIST >> =================================================================== >> RCS file: /cvs/ports/net/iodine/pkg/PLIST,v >> retrieving revision 1.3 >> diff -u -p -r1.3 PLIST >> --- pkg/PLIST 30 Mar 2009 09:17:45 -0000 1.3 >> +++ pkg/PLIST 20 Oct 2015 13:31:47 -0000 >> @@ -4,3 +4,5 @@ >> @man man/man8/iodine.8 >> @bin sbin/iodine >> @bin sbin/iodined >> +share/doc/pkg-readmes/${FULLPKGNAME} >> +@rcscript ${RCDIR}/iodined >> Index: pkg/README >> =================================================================== >> RCS file: pkg/README >> diff -N pkg/README >> --- /dev/null 1 Jan 1970 00:00:00 -0000 >> +++ pkg/README 20 Oct 2015 13:31:47 -0000 >> @@ -0,0 +1,16 @@ >> +$OpenBSD$ >> + >> ++----------------------------------------------------------------------- >> +| Running ${FULLPKGNAME} on OpenBSD >> ++----------------------------------------------------------------------- >> + >> +Starting iodined at boot time >> +============================= >> +An rc.d(8) script is provided, so you can add "iodined" to the pkg_scripts >> +line in /etc/rc.conf.local. >> + >> +The iodine server must be configured through the command line, see >> iodined(8) >> +for options. Do _not_ modify the ${RCDIR}/iodined script, but instead add a >> +line to /etc/rc.conf.local using the format of the following example: >> + >> +iodined_flags="-u _iodine -t /var/empty -c -P secret 192.168.53.1 >> t1.mydomain.com" > > You could also do this to append to pkg_scripts and set the flags: > # rcctl set iodine status on > # rcctl set iodine flags -u _iodine -t /var/empty -c -P secret 192.168.53.1 > t1.mydomain.com
Thank you. After a quick test it seems that it should be "rcctl set iodined ..." though. I've attached an updated version of the patch. >> Index: pkg/iodined.rc >> =================================================================== >> RCS file: pkg/iodined.rc >> diff -N pkg/iodined.rc >> --- /dev/null 1 Jan 1970 00:00:00 -0000 >> +++ pkg/iodined.rc 20 Oct 2015 13:31:47 -0000 >> @@ -0,0 +1,12 @@ >> +#!/bin/sh >> +# >> +# $OpenBSD$ >> + >> +daemon="${TRUEPREFIX}/sbin/iodined" >> + >> +. /etc/rc.d/rc.subr >> + >> +pexp="${daemon} .*" > > The default pexp does not match? The default pexp does not match, because iodined change its cmdline in order to hide the password given with -P. > >> +rc_reload=NO >> + >> +rc_cmd $1 > >
Index: Makefile =================================================================== RCS file: /cvs/ports/net/iodine/Makefile,v retrieving revision 1.14 diff -u -p -r1.14 Makefile --- Makefile 19 Jun 2014 22:45:56 -0000 1.14 +++ Makefile 20 Oct 2015 15:24:41 -0000 @@ -4,6 +4,7 @@ COMMENT= tunnel IPv4 data through DNS DISTNAME= iodine-0.7.0 CATEGORIES= net +REVISION= 0 HOMEPAGE= http://code.kryo.se/iodine/ Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/net/iodine/pkg/PLIST,v retrieving revision 1.3 diff -u -p -r1.3 PLIST --- pkg/PLIST 30 Mar 2009 09:17:45 -0000 1.3 +++ pkg/PLIST 20 Oct 2015 15:24:41 -0000 @@ -4,3 +4,5 @@ @man man/man8/iodine.8 @bin sbin/iodine @bin sbin/iodined +share/doc/pkg-readmes/${FULLPKGNAME} +@rcscript ${RCDIR}/iodined Index: pkg/README =================================================================== RCS file: pkg/README diff -N pkg/README --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/README 20 Oct 2015 15:24:41 -0000 @@ -0,0 +1,13 @@ +$OpenBSD$ + ++----------------------------------------------------------------------- +| Running ${FULLPKGNAME} on OpenBSD ++----------------------------------------------------------------------- + +Starting iodined at boot time +============================= +The iodine server must be configured through the command line, see iodined(8) +for options. An rc.d(8) script is provided, to start iodined at boot time: + +# rcctl set iodined status on +# rcctl set iodined flags -u _iodine -t /var/empty -c -P secret 192.168.53.1 t1.mydomain.com Index: pkg/iodined.rc =================================================================== RCS file: pkg/iodined.rc diff -N pkg/iodined.rc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/iodined.rc 20 Oct 2015 15:24:41 -0000 @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $OpenBSD$ + +daemon="${TRUEPREFIX}/sbin/iodined" + +. /etc/rc.d/rc.subr + +pexp="${daemon} .*" +rc_reload=NO + +rc_cmd $1