diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-20 20:05:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-20 20:05:45 +0000 |
commit | 78ce809216face4867cccb1ce207c9e35440c1e5 (patch) | |
tree | fe7e5b3b5c9b959e327b5f506ad2d9ca52d7f9c1 /src/backend/postmaster/postmaster.c | |
parent | c9de6b922e4f8c2647c64a67e86d4a95e3fca2cc (diff) | |
download | postgresql-78ce809216face4867cccb1ce207c9e35440c1e5.tar.gz postgresql-78ce809216face4867cccb1ce207c9e35440c1e5.zip |
Postpone pg_timezone_initialize() until after creation of postmaster.pid,
since it can take a fair amount of time and this can confuse boot scripts
that expect postmaster.pid to appear quickly. Move initialization of SSL
library and preloaded libraries to after that point, too, just for luck.
Per reports from Tony Caduto and others.
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 527677e0e75..ad6477a372d 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.470 2005/10/17 16:24:19 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.471 2005/10/20 20:05:44 tgl Exp $ * * NOTES * @@ -626,7 +626,8 @@ PostmasterMain(int argc, char *argv[]) } /* - * Other one-time internal sanity checks can go here. + * Other one-time internal sanity checks can go here, if they are fast. + * (Put any slow processing further down, after postmaster.pid creation.) */ if (!CheckDateTokenTables()) { @@ -661,21 +662,6 @@ PostmasterMain(int argc, char *argv[]) } /* - * Initialize SSL library, if specified. - */ -#ifdef USE_SSL - if (EnableSSL) - secure_initialize(); -#endif - - /* - * process any libraries that should be preloaded and optionally - * pre-initialized - */ - if (preload_libraries_string) - process_preload_libraries(preload_libraries_string); - - /* * Fork away from controlling terminal, if -S specified. * * Must do this before we grab any interlock files, else the interlocks will @@ -696,6 +682,30 @@ PostmasterMain(int argc, char *argv[]) CreateDataDirLockFile(true); /* + * If timezone is not set, determine what the OS uses. (In theory this + * should be done during GUC initialization, but because it can take as + * much as several seconds, we delay it until after we've created the + * postmaster.pid file. This prevents problems with boot scripts that + * expect the pidfile to appear quickly.) + */ + pg_timezone_initialize(); + + /* + * Initialize SSL library, if specified. + */ +#ifdef USE_SSL + if (EnableSSL) + secure_initialize(); +#endif + + /* + * process any libraries that should be preloaded and optionally + * pre-initialized + */ + if (preload_libraries_string) + process_preload_libraries(preload_libraries_string); + + /* * Remove old temporary files. At this point there can be no other * Postgres processes running in this directory, so this should be safe. */ |