Skip to content

Commit ac0d141

Browse files
committed
Do not start if postmaster is running.
1 parent 10283ee commit ac0d141

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/backend/tcop/postgres.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.138 1999/12/22 00:07:15 inoue Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.139 2000/01/09 12:17:33 ishii Exp $
1111
*
1212
* NOTES
1313
* this is the "main" module of the postgres backend and
@@ -1356,6 +1356,19 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
13561356
argv[0]);
13571357
proc_exit(1);
13581358
}
1359+
1360+
/*
1361+
* Try to create pid file.
1362+
*/
1363+
SetPidFname(DataDir);
1364+
if (SetPidFile(-getpid())) {
1365+
proc_exit(0);
1366+
}
1367+
/*
1368+
* Register clean up proc.
1369+
*/
1370+
on_proc_exit(UnlinkPidFile, NULL);
1371+
13591372
BaseInit();
13601373
snprintf(XLogDir, MAXPGPATH, "%s%cpg_xlog",
13611374
DataDir, SEP_CHAR);
@@ -1499,7 +1512,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
14991512
if (!IsUnderPostmaster)
15001513
{
15011514
puts("\nPOSTGRES backend interactive interface ");
1502-
puts("$Revision: 1.138 $ $Date: 1999/12/22 00:07:15 $\n");
1515+
puts("$Revision: 1.139 $ $Date: 2000/01/09 12:17:33 $\n");
15031516
}
15041517

15051518
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy