Changeset 795
- Timestamp:
- 08/08/07 06:48:13
- Files:
-
- buildout/pcl.buildout/trunk/init_postgresql.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
buildout/pcl.buildout/trunk/init_postgresql.py
r793 r795 23 23 raise RuntimeError('Error running command: %s' % cmd) 24 24 25 if os.path.exists(wrapper_script): 25 PIDFILE = '%s/postmaster.pid' % PGDATA 26 if os.path.exists(wrapper_script) and os.path.exists(PIDFILE): 27 print 'Shutting down PostgreSQL server...' 26 28 system('%s stop' % wrapper_script) 29 while os.path.exists(PIDFILE): 30 time.sleep(1) 27 31 28 32 # Clean up existing parts … … 30 34 shutil.rmtree(PGDATA) 31 35 36 assert not os.path.exists(PGDATA) 32 37 os.makedirs(PGDATA) 33 38 … … 50 55 # Create a database and import the world borders data set into the db 51 56 # for testing 52 53 57 system('%s/bin/shp2pgsql -I -s 4269 %s postgis.world_borders > /tmp/wb.sql' % (POSTGIS, DATASET)) 54 58 system('%s/bin/createdb --port=%s %s' % (PGROOT, PGPORT, PGDBNAME))
