Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I can start postgres with:

# Start Postgres
/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

Where can I put that to start up when I start the machine up?

I can put it in my .bash_login file but then I get a new instance of postgres each time I do a new window which is not good.

I only want it to happen when I initially log in to the machine.

This is for OS-X Lion, Macbook Air bought Nov 2011

share|improve this question

1 Answer 1

up vote 3 down vote accepted

In general for Apple systems you should add a .plist to your Launchd configuration.

Exactly how to do this varies a little from Mac OS X release to Mac OS X release. You haven't specified yours so I can't give a more specific answer.

The main thing to be aware of is that your postgresql plist should make sure to run PostgreSQL as the correct user.

If you use the EnterpriseDB installers for PostgreSQL they should take care of this task for you.

share|improve this answer
    
launchd is definitely the recommended way to go. I like Lingon (peterborgapps.com/lingon/index.html) for setting up the tasks. Easier than messing with plist files. –  Vickash Jul 5 '12 at 18:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.