* Prevent runit from deleting own processing file
@ 2024-03-28 1:15 Andrew Stiegmann
2024-03-28 2:26 ` Alexis
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Stiegmann @ 2024-03-28 1:15 UTC (permalink / raw)
To: supervision
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]
Evening folks. Wanted to share a patch I recently put together to prevent
a runaway busyloop in svlogd when system time is far behind. It
effectively prevents svlogd from deleting the file its about to process,
which can happen when system time is far behind. Cheers.
diff --git a/src/svlogd.c b/src/svlogd.c
index 2e79219..d47fc47 100644
--- a/src/svlogd.c
+++ b/src/svlogd.c
@@ -256,6 +256,10 @@ void rmoldest(struct logdir *ld) {
if (unlink(f->d_name) == -1)
warn2("unable to unlink processor leftover", f->d_name);
}
+ else if (!str_diff(ld->fnsave, f->d_name)) {
+ if (verbose)
+ strerr_warn5(INFO, "preserve: ", ld->name, "/", ld->fnsave, 0);
+ }
else {
++n;
if (str_diff(f->d_name, oldest) < 0) byte_copy(oldest, 27,
f->d_name);
--
Andrew AV. Stiegmann
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Prevent runit from deleting own processing file
2024-03-28 1:15 Prevent runit from deleting own processing file Andrew Stiegmann
@ 2024-03-28 2:26 ` Alexis
2024-03-28 3:27 ` Andrew Stiegmann
0 siblings, 1 reply; 3+ messages in thread
From: Alexis @ 2024-03-28 2:26 UTC (permalink / raw)
To: supervision; +Cc: Andrew Stiegmann
Andrew Stiegmann <andrew.stiegmann@gmail.com> writes:
> Evening folks. Wanted to share a patch I recently put together
> to prevent
> a runaway busyloop in svlogd when system time is far behind. It
> effectively prevents svlogd from deleting the file its about to
> process,
> which can happen when system time is far behind. Cheers.
You might like to also consider opening a PR in Void's 'runit'
repo:
https://github.com/void-linux/runit
Alexis.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Prevent runit from deleting own processing file
2024-03-28 2:26 ` Alexis
@ 2024-03-28 3:27 ` Andrew Stiegmann
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Stiegmann @ 2024-03-28 3:27 UTC (permalink / raw)
To: Alexis; +Cc: supervision
[-- Attachment #1: Type: text/plain, Size: 649 bytes --]
Will do. Thanks for pointing it out.
On Wed, Mar 27, 2024 at 6:27 PM Alexis <flexibeast@gmail.com> wrote:
> Andrew Stiegmann <andrew.stiegmann@gmail.com> writes:
>
> > Evening folks. Wanted to share a patch I recently put together
> > to prevent
> > a runaway busyloop in svlogd when system time is far behind. It
> > effectively prevents svlogd from deleting the file its about to
> > process,
> > which can happen when system time is far behind. Cheers.
>
> You might like to also consider opening a PR in Void's 'runit'
> repo:
>
> https://github.com/void-linux/runit
>
>
> Alexis.
>
--
Andrew AV. Stiegmann
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-28 3:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 1:15 Prevent runit from deleting own processing file Andrew Stiegmann
2024-03-28 2:26 ` Alexis
2024-03-28 3:27 ` Andrew Stiegmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).