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
ffdd5a0e
Commit
ffdd5a0e
authored
Aug 20, 2012
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove external PID file on postmaster exit
parent
029722ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+14
-1
No files found.
src/backend/postmaster/postmaster.c
View file @
ffdd5a0e
...
...
@@ -329,6 +329,7 @@ static DNSServiceRef bonjour_sdref = NULL;
/*
* postmaster.c - function prototypes
*/
static
void
unlink_external_pid_file
(
int
status
,
Datum
arg
);
static
void
getInstallationPaths
(
const
char
*
argv0
);
static
void
checkDataDir
(
void
);
static
Port
*
ConnCreate
(
int
serverFd
);
...
...
@@ -1071,7 +1072,6 @@ PostmasterMain(int argc, char *argv[])
{
fprintf
(
fpidfile
,
"%d
\n
"
,
MyProcPid
);
fclose
(
fpidfile
);
/* Should we remove the pid file on postmaster exit? */
/* Make PID file world readable */
if
(
chmod
(
external_pid_file
,
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IROTH
)
!=
0
)
...
...
@@ -1081,6 +1081,8 @@ PostmasterMain(int argc, char *argv[])
else
write_stderr
(
"%s: could not write external PID file
\"
%s
\"
: %s
\n
"
,
progname
,
external_pid_file
,
strerror
(
errno
));
on_proc_exit
(
unlink_external_pid_file
,
0
);
}
/*
...
...
@@ -1182,6 +1184,17 @@ PostmasterMain(int argc, char *argv[])
}
/*
* on_proc_exit callback to delete external_pid_file
*/
static
void
unlink_external_pid_file
(
int
status
,
Datum
arg
)
{
if
(
external_pid_file
)
unlink
(
external_pid_file
);
}
/*
* Compute and check the directory paths to files that are part of the
* installation (as deduced from the postgres executable's own location)
...
...
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