Initialize the database correctly on F7+.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Thu, 29 Nov 2007 21:45:48 +0000 (21:45 +0000)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Thu, 29 Nov 2007 21:45:48 +0000 (21:45 +0000)
plc.d/postgresql

index f5ad0d0..43fc7aa 100755 (executable)
@@ -46,6 +46,12 @@ postgresql_start ()
     return 1
 }
 
+postgresql_init ()
+{
+    service postgresql initdb &> /dev/null || :
+    postgresql_start
+}
+
 case "$1" in
     start)
        if [ "$PLC_DB_ENABLED" != "1" ] ; then
@@ -69,7 +75,7 @@ case "$1" in
        # PostgreSQL must be started at least once to bootstrap
        # /var/lib/pgsql/data
        if [ ! -f $postgresql_conf ] ; then
-           postgresql_start
+           postgresql_init
            check
            service postgresql stop
            check