Skip to content

Commit

Permalink
Merge pull request #1685 from eeff/v2.6
Browse files Browse the repository at this point in the history
Pick to v2.6 fix: pid file work around fs.protected_regular
  • Loading branch information
fengzeroz authored Nov 22, 2023
2 parents d98d344 + f80df71 commit e088de9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,14 @@ int neuron_already_running()
fd = open(NEURON_DAEMON_LOCK_FNAME, O_RDWR | O_CREAT,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0) {
nlog_error("cannot open %s reason: %s\n", NEURON_DAEMON_LOCK_FNAME,
strerror(errno));
exit(1);
// work around fs.protected_regular
fd = open(NEURON_DAEMON_LOCK_FNAME, O_RDWR,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0) {
nlog_error("cannot open %s reason: %s\n", NEURON_DAEMON_LOCK_FNAME,
strerror(errno));
exit(1);
}
}

// try to lock file
Expand Down

0 comments on commit e088de9

Please sign in to comment.