mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Don't consider non-existence of a PID file an error, we should be able
to proceed anyway as this most likely mean that the process has been terminated. PR: bin/140397 Submitted by: Dan Lukes <dan obluda cz> MFC after: 1 month
This commit is contained in:
parent
8e9683767c
commit
f65917cdc3
1 changed files with 12 additions and 1 deletions
|
|
@ -1779,7 +1779,18 @@ set_swpid(struct sigwork_entry *swork, const struct conf_entry *ent)
|
|||
|
||||
f = fopen(ent->pid_file, "r");
|
||||
if (f == NULL) {
|
||||
warn("can't open pid file: %s", ent->pid_file);
|
||||
if (errno == ENOENT) {
|
||||
/*
|
||||
* Warn if the PID file doesn't exist, but do
|
||||
* not consider it an error. Most likely it
|
||||
* means the process has been terminated,
|
||||
* so it should be safe to rotate any log
|
||||
* files that the process would have been using.
|
||||
*/
|
||||
swork->sw_pidok = 1;
|
||||
warnx("pid file doesn't exist: %s", ent->pid_file);
|
||||
} else
|
||||
warn("can't open pid file: %s", ent->pid_file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue