Subject: [32751] net/dhcp startupitem
Hi Blair, Executable startupitems are the preferred type. Daemondo can track pids automatically and reliably restart an application if it quits. See the guide on this: http://guide.macports.org/#reference.startupitems Given how startupitem executables work, I don't see an advantage to reverting to a "script" startupitem. Or is there something I am missing particular to dhcp? Mark
Log Message: ----------- Use a startupitem method that uses dhcpd's PID file.
Modified Paths: -------------- trunk/dports/net/dhcp/Portfile
Modified: trunk/dports/net/dhcp/Portfile =================================================================== --- trunk/dports/net/dhcp/Portfile 2008-01-13 03:07:29 UTC (rev 32750) +++ trunk/dports/net/dhcp/Portfile 2008-01-13 03:35:29 UTC (rev 32751) @@ -4,7 +4,7 @@
name dhcp version 3.1.0 -revision 1 +revision 2 categories net description ISC dhcpd server long_description ISC's Dynamic Host Configuration Protocol Distribution \ @@ -40,8 +40,9 @@ configure.pre_args
startupitem.create yes -startupitem.name dhcpd -startupitem.executable ${prefix}/sbin/dhcpd +startupitem.start "${prefix}/sbin/dhcpd" +startupitem.restart "/bin/kill -HUP \$(/bin/cat ${prefix}/var/run/dhcpd.pid)" +startupitem.stop "/bin/kill -15 \$(/bin/cat ${prefix}/var/run/dhcpd.pid)"
Hi Mark, I was seeing the following: 1) One dhcpd would start. 2) Every 10 seconds thereafter, another dhcpd would be started, but it couldn't bind to the port since the first one was running. It appears that the startupitem infrastructure wasn't keeping track of dhcpd running and deamonizing itself. I haven't read the guide yet. What do you suggest? Putting a -f to dhcpd so it stays in the foreground? Regards, Blair -- Blair Zajac, Ph.D. CTO, OrcaWare Technologies <blair@orcaware.com> Subversion training, consulting and support http://www.orcaware.com/svn/ On Jan 13, 2008, at 12:11 PM, markd@macports.org wrote:
Hi Blair,
Executable startupitems are the preferred type. Daemondo can track pids automatically and reliably restart an application if it quits. See the guide on this:
http://guide.macports.org/#reference.startupitems
Given how startupitem executables work, I don't see an advantage to reverting to a "script" startupitem. Or is there something I am missing particular to dhcp?
Mark
Log Message: ----------- Use a startupitem method that uses dhcpd's PID file.
Modified Paths: -------------- trunk/dports/net/dhcp/Portfile
Modified: trunk/dports/net/dhcp/Portfile =================================================================== --- trunk/dports/net/dhcp/Portfile 2008-01-13 03:07:29 UTC (rev 32750) +++ trunk/dports/net/dhcp/Portfile 2008-01-13 03:35:29 UTC (rev 32751) @@ -4,7 +4,7 @@
name dhcp version 3.1.0 -revision 1 +revision 2 categories net description ISC dhcpd server long_description ISC's Dynamic Host Configuration Protocol Distribution \ @@ -40,8 +40,9 @@ configure.pre_args
startupitem.create yes -startupitem.name dhcpd -startupitem.executable ${prefix}/sbin/dhcpd +startupitem.start "${prefix}/sbin/dhcpd" +startupitem.restart "/bin/kill -HUP \$(/bin/cat ${prefix}/var/run/dhcpd.pid)" +startupitem.stop "/bin/kill -15 \$(/bin/cat ${prefix}/var/run/dhcpd.pid)"
_______________________________________________ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macports-dev
Hi Mark, The guild says this: "startupitem.executable. Specifies the name of the daemon to be run in the background. It may have multiple arguments, but they must be appropriate for a call to exec; arbitrary shell code may not be used." Should the actual daemon remain in the foreground so that the parent parent process can wait() on it? Should the daemon make a PID file in a known location? The guide could expand on this a bit. Regards, Blair On Jan 13, 2008, at 12:11 PM, markd@macports.org wrote:
Hi Blair,
Executable startupitems are the preferred type. Daemondo can track pids automatically and reliably restart an application if it quits. See the guide on this:
http://guide.macports.org/#reference.startupitems
Given how startupitem executables work, I don't see an advantage to reverting to a "script" startupitem. Or is there something I am missing particular to dhcp?
Mark
Log Message: ----------- Use a startupitem method that uses dhcpd's PID file.
Modified Paths: -------------- trunk/dports/net/dhcp/Portfile
Modified: trunk/dports/net/dhcp/Portfile =================================================================== --- trunk/dports/net/dhcp/Portfile 2008-01-13 03:07:29 UTC (rev 32750) +++ trunk/dports/net/dhcp/Portfile 2008-01-13 03:35:29 UTC (rev 32751) @@ -4,7 +4,7 @@
name dhcp version 3.1.0 -revision 1 +revision 2 categories net description ISC dhcpd server long_description ISC's Dynamic Host Configuration Protocol Distribution \ @@ -40,8 +40,9 @@ configure.pre_args
startupitem.create yes -startupitem.name dhcpd -startupitem.executable ${prefix}/sbin/dhcpd +startupitem.start "${prefix}/sbin/dhcpd" +startupitem.restart "/bin/kill -HUP \$(/bin/cat ${prefix}/var/run/dhcpd.pid)" +startupitem.stop "/bin/kill -15 \$(/bin/cat ${prefix}/var/run/dhcpd.pid)"
-- Blair Zajac, Ph.D. CTO, OrcaWare Technologies <blair@orcaware.com> Subversion training, consulting and support http://www.orcaware.com/svn/
Mark, It works fine if I use this: startupitem.create yes startupitem.name dhcpd startupitem.executable ${prefix}/sbin/dhcpd -f startupitem.netchange yes How's that? Regards, Blair On Jan 13, 2008, at 12:36 PM, Blair Zajac wrote:
Hi Mark,
The guild says this:
"startupitem.executable. Specifies the name of the daemon to be run in the background. It may have multiple arguments, but they must be appropriate for a call to exec; arbitrary shell code may not be used."
Should the actual daemon remain in the foreground so that the parent parent process can wait() on it? Should the daemon make a PID file in a known location?
The guide could expand on this a bit.
Regards, Blair
On Jan 13, 2008, at 12:11 PM, markd@macports.org wrote:
Hi Blair,
Executable startupitems are the preferred type. Daemondo can track pids automatically and reliably restart an application if it quits. See the guide on this:
http://guide.macports.org/#reference.startupitems
Given how startupitem executables work, I don't see an advantage to reverting to a "script" startupitem. Or is there something I am missing particular to dhcp?
Mark
Log Message: ----------- Use a startupitem method that uses dhcpd's PID file.
Modified Paths: -------------- trunk/dports/net/dhcp/Portfile
Modified: trunk/dports/net/dhcp/Portfile =================================================================== --- trunk/dports/net/dhcp/Portfile 2008-01-13 03:07:29 UTC (rev 32750) +++ trunk/dports/net/dhcp/Portfile 2008-01-13 03:35:29 UTC (rev 32751) @@ -4,7 +4,7 @@
name dhcp version 3.1.0 -revision 1 +revision 2 categories net description ISC dhcpd server long_description ISC's Dynamic Host Configuration Protocol Distribution \ @@ -40,8 +40,9 @@ configure.pre_args
startupitem.create yes -startupitem.name dhcpd -startupitem.executable ${prefix}/sbin/dhcpd +startupitem.start "${prefix}/sbin/dhcpd" +startupitem.restart "/bin/kill -HUP \$(/bin/cat ${prefix}/var/run/dhcpd.pid)" +startupitem.stop "/bin/kill -15 \$(/bin/cat ${prefix}/var/run/dhcpd.pid)"
-- Blair Zajac, Ph.D. CTO, OrcaWare Technologies <blair@orcaware.com> Subversion training, consulting and support http://www.orcaware.com/svn/
participants (2)
-
Blair Zajac
-
markd@macports.org