PostgreSQL 91 does not start automatically

Daniel J. Luke dluke at geeklair.net
Wed Apr 25 14:07:21 PDT 2012


On Apr 25, 2012, at 5:04 PM, Jeremy Lavergne wrote:
>> $less /Library/LaunchDaemons/org.macports.apache2.plist 
>> <?xml version='1.0' encoding='UTF-8'?>
>> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
>> <plist version='1.0'>
>> <dict>
>> <key>Label</key><string>org.macports.apache2</string>
>> <key>ProgramArguments</key>
>> <array>
>>       <string>/opt/local/bin/daemondo</string>
>>       <string>--label=apache2</string>
>>       <string>--start-cmd</string>
>>       <string>/opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper</string>
>>       <string>start</string>
>>       <string>;</string>
>>       <string>--stop-cmd</string>
>>       <string>/opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper</string>
>>       <string>stop</string>
>>       <string>;</string>
>>       <string>--restart-cmd</string>
>>       <string>/opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper</string>
>>       <string>restart</string>
>>       <string>;</string>
>>       <string>--pid=none</string>
>> </array>
>> <key>Debug</key><false/>
>> <key>Disabled</key><true/>
>> <key>KeepAlive</key><true/>
>> </dict>
>> </plist>
> 
> Looks like it's not waiting for networking, and it's disabled?
> 
> I'd change KeepAlive from a bool to a dict, and inside it place NetworkState set to true.
> 
> From man 5 launchd.plist:
>     KeepAlive <boolean or dictionary of stuff>
>           NetworkState <boolean>
>           If true, the job will be kept alive as long as the network is up,
>           where up is defined as at least one non-loopback interface being up
>           and having IPv4 or IPv6 addresses assigned to them.  If false, the
>           job will be kept alive in the inverse condition.


One thing you can do, is to make a copy of the plist of your own (give it a new name that won't conflict with the macports namespace) and use it to manage your apache2 instance.

You don't get port load/port unload, but you can do the above customization and not have it wiped out when you upgrade apache2 in the future.

--
Daniel J. Luke                                                                   
+========================================================+                        
| *---------------- dluke at geeklair.net ----------------* |                          
| *-------------- http://www.geeklair.net -------------* |                          
+========================================================+                        
|   Opinions expressed are mine and do not necessarily   |                          
|          reflect the opinions of my employer.          |                          
+========================================================+





More information about the macports-users mailing list