Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c8702dcb
Commit
c8702dcb
authored
Aug 28, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Propogate pg_ctl -D to the postmaster for command-line identification.
parent
7531d2fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_ctl/pg_ctl.c
+17
-8
No files found.
src/bin/pg_ctl/pg_ctl.c
View file @
c8702dcb
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.2
6 2004/08/28 21:01:38
momjian Exp $
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.2
7 2004/08/28 22:04:01
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -67,6 +67,7 @@ static ShutdownMode shutdown_mode = SMART_MODE;
...
@@ -67,6 +67,7 @@ static ShutdownMode shutdown_mode = SMART_MODE;
static
int
sig
=
SIGTERM
;
/* default */
static
int
sig
=
SIGTERM
;
/* default */
static
CtlCommand
ctl_command
=
NO_COMMAND
;
static
CtlCommand
ctl_command
=
NO_COMMAND
;
static
char
*
pg_data
=
NULL
;
static
char
*
pg_data
=
NULL
;
static
char
*
pgdata_opt
=
NULL
;
static
char
*
post_opts
=
NULL
;
static
char
*
post_opts
=
NULL
;
static
const
char
*
progname
;
static
const
char
*
progname
;
static
char
*
log_file
=
NULL
;
static
char
*
log_file
=
NULL
;
...
@@ -309,19 +310,20 @@ start_postmaster(void)
...
@@ -309,19 +310,20 @@ start_postmaster(void)
*/
*/
if
(
log_file
!=
NULL
)
if
(
log_file
!=
NULL
)
#ifndef WIN32
#ifndef WIN32
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s <
\"
%s
\"
>>
\"
%s
\"
2>&1 &%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s
%s
<
\"
%s
\"
>>
\"
%s
\"
2>&1 &%s"
,
#else
#else
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s <
\"
%s
\"
>>
\"
%s
\"
2>&1%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s
%s
<
\"
%s
\"
>>
\"
%s
\"
2>&1%s"
,
#endif
#endif
SYSTEMQUOTE
,
postgres_path
,
post_opts
,
DEVNULL
,
log_file
,
SYSTEMQUOTE
,
postgres_path
,
pgdata_opt
,
post_opts
,
SYSTEMQUOTE
);
DEVNULL
,
log_file
,
SYSTEMQUOTE
);
else
else
#ifndef WIN32
#ifndef WIN32
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s <
\"
%s
\"
2>&1 &%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s
%s
<
\"
%s
\"
2>&1 &%s"
,
#else
#else
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s <
\"
%s
\"
2>&1%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s
%s
<
\"
%s
\"
2>&1%s"
,
#endif
#endif
SYSTEMQUOTE
,
postgres_path
,
post_opts
,
DEVNULL
,
SYSTEMQUOTE
);
SYSTEMQUOTE
,
postgres_path
,
pgdata_opt
,
post_opts
,
DEVNULL
,
SYSTEMQUOTE
);
return
system
(
cmd
);
return
system
(
cmd
);
}
}
...
@@ -494,6 +496,10 @@ do_start(void)
...
@@ -494,6 +496,10 @@ do_start(void)
}
}
}
}
/* No -D or -D already added during server start */
if
(
ctl_command
==
RESTART_COMMAND
||
pgdata_opt
==
NULL
)
pgdata_opt
=
""
;
if
(
postgres_path
==
NULL
)
if
(
postgres_path
==
NULL
)
{
{
char
*
postmaster_path
;
char
*
postmaster_path
;
...
@@ -1210,6 +1216,9 @@ main(int argc, char **argv)
...
@@ -1210,6 +1216,9 @@ main(int argc, char **argv)
env_var
=
xmalloc
(
len
+
8
);
env_var
=
xmalloc
(
len
+
8
);
snprintf
(
env_var
,
len
+
8
,
"PGDATA=%s"
,
optarg
);
snprintf
(
env_var
,
len
+
8
,
"PGDATA=%s"
,
optarg
);
putenv
(
env_var
);
putenv
(
env_var
);
/* Show -D for easier postmaster 'ps' identification */
pgdata_opt
=
xmalloc
(
len
+
7
);
snprintf
(
pgdata_opt
,
len
+
7
,
"-D
\"
%s
\"
"
,
optarg
);
break
;
break
;
}
}
case
'l'
:
case
'l'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment