diff options
author | Eric Wong <e@yhbt.net> | 2020-07-06 04:20:12 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-07-06 08:21:35 +0000 |
commit | 89ac7eca5e1d17d7dc949b2fd0a59a5e83abf90f (patch) | |
tree | 71b3d9b4239c5ff554092b7ca46a480fc3e8ee89 | |
parent | 243aa230479edbf58af7bc349df2fde87577f64c (diff) | |
download | public-inbox-89ac7eca5e1d17d7dc949b2fd0a59a5e83abf90f.tar.gz |
inotify_add_watch(2), open(2), stat(2) may all fail due to permissions errors, especially when running -nntpd/-imapd as `nobody' as recommended.
-rw-r--r-- | lib/PublicInbox/InboxIdle.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/InboxIdle.pm b/lib/PublicInbox/InboxIdle.pm index bdb30284..0cdd2e2a 100644 --- a/lib/PublicInbox/InboxIdle.pm +++ b/lib/PublicInbox/InboxIdle.pm @@ -41,8 +41,11 @@ sub in2_arm ($$) { # PublicInbox::Config::each_inbox callback $cur->[0] = $ibx; my $lock = "$dir/".($ibx->version >= 2 ? 'inbox.lock' : 'ssoma.lock'); - my $w = $cur->[1] = $inot->watch($lock, $IN_MODIFY); - $self->{on_unlock}->{$w->name} = $ibx; + if (my $w = $cur->[1] = $inot->watch($lock, $IN_MODIFY)) { + $self->{on_unlock}->{$w->name} = $ibx; + } else { + warn "E: ".ref($inot)."->watch($lock, IN_MODIFY) failed: $!\n"; + } # TODO: detect deleted packs (and possibly other files) } |