Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#12931 closed defect (fixed)

Portfile plist generation support "--restart-netchange" option

Reported by: bdb@… Owned by: macports-tickets@…
Priority: High Milestone: MacPorts 1.6
Component: base Version: 1.5.0
Keywords: Cc: nox@…, bdb@…, ryandesign (Ryan Schmidt)


Portfiles for bind9, lighttpd and dhcpd need to generate "--restart-netchange" option into the .plist. Without this option, the daemons may fail to start on some systems. There are two workarounds: i) launchctl unload and then launchctl load, and ii) adding --restart-netchange option to the plist.

See these threads for details:

It appears the fix is required in the MacPorts base system in the portstartupitem.tcl code. I'll preface this with "I don't know tcl" disclaimer... To my eyes it appears that one area of focus for patching startupitem_create_darwin_launchd is in this section of code:

proc startupitem_create_darwin_launchd {args} { ... ... ...

set daemondest LaunchDaemons set itemdir ${prefix}/etc/${daemondest}/${uniquename} set args [list \

"${prefix}/bin/daemondo" \ "--label=${itemname}" \ ]

If "set args [list \..." was modified as follows:

set args [list \

"${prefix}/bin/daemondo" \ "--label=${itemname}" \ "--restart-netchange" ]

then it would probably generate a correct plist for bind9/lighttpd/dhcp/etc but would change ALL plists generated. Therefore it seems a conditional is required to generate the two different forms of plists.

Change History (4)

comment:1 Changed 13 years ago by nox@…

Milestone: MacPorts base bugs

comment:2 Changed 13 years ago by ryandesign (Ryan Schmidt)

Cc: bdb@… ryandesign@… added

comment:3 Changed 13 years ago by nox@…

Cc: nox@… added
Milestone: MacPorts base bugsMacPorts base enhancements
Resolution: fixed
Status: newclosed

Added startupitem.netchange boolean flag in r30086.

comment:4 Changed 11 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 1.6
Note: See TracTickets for help on using tickets.