multitail
multitail copied to clipboard
Issue on small systems which use tail from busybox
Hi guys,
I ported/created package for ARM Aarch64 v8, and would like to use it on slim linux systems which only have busybox. (embedded devices)
The issue here is, that tail from busybox does not know the --follow=name argument. Indeed it uses -f/-F for that.
I fixed this issue for me (quick & dirty) by patching this:
Date: Thu, 22 Sep 2022 10:14:09 +0200
Subject: [PATCH] Replaced tail argument --follow=name to -f, since the tail
from busybox does not support --follow=name
---
exec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/exec.c b/exec.c
index 9cc2de7..ae18aed 100644
--- a/exec.c
+++ b/exec.c
@@ -83,7 +83,7 @@ int start_tail(char *filename, char retry_open, char follow_filename, int initia
if (follow_filename)
{
#if defined(linux) || defined(__CYGWIN__) || defined(__GNU__)
- pars[npars++] = "--follow=name";
+ pars[npars++] = "-f";
#elif defined(__OpenBSD__)
pars[npars++] = "-f";
#else
@@ -99,7 +99,7 @@ int start_tail(char *filename, char retry_open, char follow_filename, int initia
{
#if !defined(linux) && !defined(__CYGWIN__) && !defined(__GNU__)
if (follow_filename && gnu_tail)
- pars[npars++] = "--follow=name";
+ pars[npars++] = "-f";
#endif
/* check the posix compliance level */
I think a cleaner solution would be to add a #if-else case for busybox case here. But I wanted to share this patch with you anyway, maybe you want to implement something similar.
Greetings
Thank you but I vaguely remember I used --follow=name for a reason. So a busybox specific fix would be preferred.
I can open an MR with a specific "busybox" fix, when I get time for this. Just asking for curiosity: Where does the definition "linux" got set?
Best regards, Thomas
"linux" is set by the preprocessor I think