Merge pull request #1685 from eeff/v2.6

Pick to v2.6 fix: pid file work around fs.protected_regular
This commit is contained in:
fengzeroz
2023-11-22 10:07:01 +08:00
committed by GitHub
+8 -3
View File
@@ -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