Menu

Comment on StartupItems script

2005-08-19
2012-08-31
  • Joseph Lamoree

    Joseph Lamoree - 2005-08-19

    I don't know if others have the situation I have, but I'll offer up this tip.

    I have an installation of PostgreSQL on my PowerBook so I can work while I'm on the road. But I don't want it to run all the time -- I only need it when I'm doing work that requires it.

    So, I edited /etc/hostconfig with POSTGRES=-NO- to prevent it from starting when I boot up. But if that's the only change I make, then I won't be able to run /Library/StartupItems/PostgreSQL start maunally because the start() function will see that $POSTGRES is -NO-.

    The solution I've settled upon is to make a change to the startup script like so:

    jlamoree$ diff -w PostgreSQL PostgreSQL.dist
    53,54d52
    < FORCE_START="${2:--NO-}"
    <
    57c55,57
    < if [ "${POSTGRES:=-YES-}" = "-YES-" -o "$FORCE_START" != "-NO-" ]; then


    >
    > if [ "${POSTGRES:=-YES-}" = "-YES-" ]; then
    >

    With this in place, I can run the following to start up the database when I need it:
    root# /Library/StartupItems/PostgreSQL/PostgreSQL start force

    This is also helpful to prevent conflicts with the Apple Remote Desktop database, if installed.

     
    • Andy Satori

      Andy Satori - 2005-08-19

      Good thought, I think I'll modify both that and the startup manager to support this. Thanks

       

Log in to post a comment.

MongoDB Logo MongoDB