mirror of
https://github.com/emqx/neuron.git
synced 2026-10-21 08:45:47 +08:00
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:
+8
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user