mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Do not exit if problem with PID file
This commit is contained in:
parent
6ae0c8a974
commit
4936b76915
@ -29721,7 +29721,6 @@ void server_loop(void) {
|
|||||||
if (stat(pidfile, &finfo) >= 0) {
|
if (stat(pidfile, &finfo) >= 0) {
|
||||||
/* never overwrite a file */
|
/* never overwrite a file */
|
||||||
eprintf("Refuse to overwrite existing file \"%s\".\n", pidfile);
|
eprintf("Refuse to overwrite existing file \"%s\".\n", pidfile);
|
||||||
_exit(EXIT_FAILURE); /* don't call atexit() hook */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29729,14 +29728,12 @@ void server_loop(void) {
|
|||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
sprintf(str, "Error creating pid file \"%s\"", pidfile);
|
sprintf(str, "Error creating pid file \"%s\"", pidfile);
|
||||||
eprintf("%s; %s\n", str, strerror(errno));
|
eprintf("%s; %s\n", str, strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf, "%d\n", (int) getpid());
|
sprintf(buf, "%d\n", (int) getpid());
|
||||||
if (write(fd, buf, strlen(buf)) == -1) {
|
if (write(fd, buf, strlen(buf)) == -1) {
|
||||||
sprintf(str, "Error writing to pid file \"%s\"", pidfile);
|
sprintf(str, "Error writing to pid file \"%s\"", pidfile);
|
||||||
eprintf("%s; %s\n", str, strerror(errno));
|
eprintf("%s; %s\n", str, strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user