having programs launch on reboot

Puneet Kishor punk.kish at gmail.com
Mon Dec 19 14:53:16 PST 2011


On Dec 19, 2011, at 3:02 PM, Brandon Allbery wrote:

> On Mon, Dec 19, 2011 at 15:03, Puneet Kishor <punk.kish at gmail.com> wrote:
> 
>> I thought the -w switch was supposed to disable the "Disabled" key, but,
>> as I said, the programs didn't start up automatically on reboot. I will try
>> again.
>> 
> 
> It does, but on Snow Leopard and Lion this will only change state hidden
> inside launchd's private config; that is, it will not actually edit the
> plist file as it did in Leopard and earlier, so simply checking for that
> key in the plist won't tell you anything.
> 
> You might want to check /Applications/Utilities/Console.app to see if
> apache logged any errors.
> 

Ok. I didn't see any errors in the Console logs. Here is what I did (step-by-step).

First, I manually edited each plist so the "Disabled" key was now set to "false".

Then I tried to unload apache2.plist, but that failed, perhaps because Apache was running (although, that is what I though unload was supposed to do... stop Apache and unload the plist). Anyway, I stopped Apache and then unloaded and loaded the plist, and that started Apache just fine.

For Postgres, I not only edited the plist as above, but since the plist really calls `/opt/local/etc/LaunchDaemons/org.macports.postgresql90-server/postgresql90-server.wrapper`, I edited that wrapper to make sure that had the right values for database and log locations (my database and logs are in non-traditional places).

Unloaded and reloaded the postgres plist, and that worked fine as well.

I have not had the same success with mysql5. Briefly, if I start mysql with `mysqld_safe`, it works fine. But, if I unload and reload the mysql plist, which, in turn, calls `/opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper`, the server doesn't start. As far as I can tell, I see no errors in the log.

Suggestions?

--
Puneet Kishor


More information about the macports-users mailing list