having programs launch on reboot

Bradley Giesbrecht pixilla at macports.org
Mon Dec 19 22:30:13 PST 2011

On Dec 19, 2011, at 2:53 PM, Puneet Kishor wrote:

> 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).

You are editing files that belong to the ports that installed them. If you upgrade apache2 or postgresql90 you will loose your changes.
The postgresql90 port includes sample conf files.
$ port contents postgresql90 | grep sample$

You are probably expected to copy this file to /opt/local/etc/postgresql.conf and edit the settings in this file to suit your needs.
This should be in the postgresql documentation.

> 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.

What logs and how are you checking them?

Running tail -f on /var/log/system.log in a second shell while load msql5-server in first shell I see this.
$ tail -f /var/log/system.log | grep mysql
Dec 19 22:24:02 pillbox org.macports.mysql5[27749]: Starting MySQL
Dec 19 22:24:02 pillbox org.macports.mysql5[27749]: .
Dec 19 22:24:03 pillbox org.macports.mysql5[27749]: .
Dec 19 22:24:05 pillbox org.macports.mysql5[27749]:  SUCCESS! 

What are you seeing?

Bradley Giesbrecht (pixilla)

More information about the macports-users mailing list